403Webshell
Server IP : 167.235.67.158  /  Your IP : 216.73.216.179
Web Server : Apache
System : Linux ubuntu-8gb-nbg1-1 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64
User : upstairsbar.co.uk ( 982)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/vinfinity.co.uk/wp-content/themes/dine/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vinfinity.co.uk/wp-content/themes/dine/inc/css.php
<?php
if ( ! function_exists( 'dine_tablet_css' ) ) :
/**
 * wrap this by tablet media query
 * return str
 * @since 3.3
 */
function dine_tablet_css( $css ) {
    
    $ipad1 = dine_get_query_screen_string_from_text( 'ipad1' );
    
    return "{$ipad1}{ {$css} }";
    
}
endif;

if ( ! function_exists( 'dine_phone_css' ) ) :
/**
 * wrap this by phone media query
 * return str
 * @since 3.3
 */
function dine_phone_css( $css ) {
    
    $iphone1 = dine_get_query_screen_string_from_text( 'iphone1' );
    
    return "{$iphone1}{ {$css} }";
    
}
endif;

/* --------------------------------|        Part 1: CSS         |-------------------------------- */
/**
 * return font url for loading in stylesheet
 * we just care about Google Fonts to load them correctly
 * if there's no google fonts needed, return empty
 * @since 3.3
------------------------------------------------------------------------------------ */
function dine_fonts() {
    
    $fonts_url = '';
	$fonts     = array();
    $subsets = trim( get_theme_mod( 'font_subsets' ) );
    
    $primary_positions = dine_primary_font_support(); // body, heading, nav
    $primary_array = [];
    foreach ( $primary_positions as $key => $value ) {
        $primary_array[] = 'font_' . $key;
    }
    $all_positions = dine_all_font_support(); // all positions
    
    $google_fonts = dine_google_fonts();
    
    // this will be array face => styles
    $final_font_array = [];
    
    foreach ( $all_positions as $id => $fontdata ) {
        
        // if fontdata std not set, it means this is merely a typo option, don't need to load
        if ( ! isset( $fontdata[ 'std' ] ) ) continue;
        
        // for image logo, don't load extra font
        if ( 'logo' == $id ) {
            if ( 'text' != get_theme_mod( 'logo_type', 'text' ) ) continue;
        }
        
        // if font source is local font, don't care
        $source = get_theme_mod( "{$id}_font_source", 'standard' );
        if  ( 'local' == $source ) continue;
        
        // get value
        $value = trim( get_theme_mod( $id . '_font', $fontdata[ 'std' ] ) );
        
        // empty value
        if ( ! $value ) continue;
        
        // if this is just primary value, don't care
        if ( in_array( $value, $primary_array ) ) continue;
        
        // now start analyze it,
        // value is like: Open Sans:400, 400i
        $explode = explode( ':', $value );
        $face = $explode[0];
        $styles = isset( $explode[1] ) ? $explode[1] : '';
        
        $face = str_replace('+', ' ', $face );
        $face = preg_replace( '/\s/', ' ', $face ); // replace all white spaces by simple white space
        $face = ucwords( $face ); // open sans ==> Open Sans
        
        // if this is not in Google font array, don't care
        if ( ! isset ( $google_fonts[ $face ] ) ) continue;
        
        // now it passes
        if ( ! isset( $final_font_array[ $face ] ) ) {
            $final_font_array[ $face ] = [];
        }
        
        // now, the styles
        $available_styles = $google_fonts[ $face ][ 'styles' ];
        $styles = trim( $styles );
        
        if ( ! $styles ) {
            $styles = '400'; // just regular
        }
        $styles = explode( ',', $styles );
        foreach ( $styles as $i => $style ) {
            $styles[ $i ] = trim( strtolower( $style ) );
        }
        
        foreach ( $available_styles as $style ) {
            
            // $style is regular then n_style is 400
            // $n_style will be the one added to the final font array
            $n_style = $style;
            if ( 'regular' == $style ) {
                $n_style = '400';
            } elseif ( 'italic' == $style ) {
                $n_style = '400italic';
            }
            
            // if we have this style
            if ( in_array( $n_style, $styles ) || in_array( $style, $styles ) ) {
                
                // but it's not in the final array yet, then add it
                if ( ! in_array( $n_style, $final_font_array[ $face ] ) ) {
                    
                    $final_font_array[ $face ][] = $n_style;
                    
                }
            }
            
        }
    
    }
    
    // NOW COMBINE THEM ALL
    $font_strs = [];
    foreach ( $final_font_array as $face => $styles ) {
        $weights = join( ',', $styles );
        $font_strs[] = "$face:$weights";
    }
    
    if ( ! empty( $font_strs ) ) {
        
        $query_args = [
            'family' => urlencode( implode( '|', $font_strs ) )
        ];
        if ( ! empty( $subsets ) ) {
            $query_args[ 'subset' ] = urlencode( $subsets );
        }
        
        // since 4.5
        $query_args[ 'display' ] = 'swap';
    
        $fonts_url = add_query_arg( $query_args , 'https://fonts.googleapis.com/css' );
        return esc_url_raw( $fonts_url );
        
    }
    
    return $fonts_url;
    
}

/**
 *
 * Font Output
 * return [
    'css' => 'the final CSS to add after CSS string',
    '@font-face' => 'CSS RULE string TO add to before of CSS string',
 ]
 * if we don't use local fonts, fontface will be empty
 * @since 3.3
------------------------------------------------------------------------------------ */
function dine_css_font_output() {
    
    $google_fonts = dine_google_fonts();
    $normal_fonts = dine_normal_fonts();
    $return = [];
    $css = [];
    $fontface = [];
    $font_css_array = [];
    
    $selector_to_value = [];
    
    $all_positions = dine_all_font_support();
    $primary_positions = dine_primary_font_support();
    $primary_array = [];
    foreach ( $primary_positions as $key => $val ) {
        $primary_array[] = 'font_' . $key;
    }
    
    $font_face_rules = '';
    $local_fonts = [];
    
    $font_faces = [];
    
    foreach ( $all_positions as $id => $fontdata ) {
        
        extract( wp_parse_args( $fontdata, [
            'std' => '',
            'selector' => '',
        ] ) );
        
        $selector_arr = explode( ',', $selector );
        $selector_arr = array_map( 'trim', $selector_arr );
        
        $source = 'standard';
        
        // this means it's not a font face element, may be font size element
        if ( ! $std ) continue;
        
        /**
         * for important positions: body, heading, nav, logo
         * we allow to upload custom font
         */
        if ( isset( $fontdata[ 'primary' ] ) && $fontdata[ 'primary' ] ) {
            
            $source = get_theme_mod( "{$id}_font_source", 'standard' );
            
            /* Local Font
            ------------------------------------ */
            if ( 'local' == $source ) {
            
                $woff2 = trim( get_theme_mod( "{$id}_font_upload_woff2" ) );
                $woff = trim( get_theme_mod( "{$id}_font_upload_woff" ) );
                $fontface = '';
                
                if ( $woff2 && $woff ) {

                    $fontface = trim( get_theme_mod( "{$id}_custom_font" ) );
                    
                    if ( ! $fontface ) {
                        
                        $pathinfo = pathinfo( $woff2 );
                        $fontface = sanitize_title_with_dashes ( $pathinfo[ 'filename' ] );
                        if ( ! $fontface ) {
                            $pathinfo = pathinfo( $woff );
                            $font = sanitize_title_with_dashes ( $pathinfo[ 'filename' ] );
                        }
                    }
                    
                    // we create a random name
                    if ( ! $fontface ) {
                        $fontface = 'dine-' . $id . '-font';
                    }

                    $fallback = get_theme_mod( "{$id}_fallback_font" );
                    if ( 'serif' != $fallback && 'cursive' != $fallback && 'monospace' != $fallback ) $fallback = 'sans-serif';

                    /* prevent duplication from loading font twice */
                    if ( ! in_array( $fontface, $local_fonts ) ) {
                        $font_face_rules .= "@font-face {font-family: {$fontface}; src: url({$woff2}) format('woff2'), url({$woff}) format('woff');}";
                    }
                    
                    // add to local font array
                    $local_fonts[] = $fontface;
                    
                    $fontface = '"' . $fontface . '"' . ", {$fallback}";
                    
                }
            
            }
            
        }
        
        if ( 'standard' == $source ) {
            
            // if google font
            $value = trim( get_theme_mod( "{$id}_font", $std ) );
            
            // if it's font_heading, font_body then just leave it
            // to treat it later
            if ( in_array( $value, $primary_array ) ) {
                if ( ! isset( $font_css_array[ $value ] ) ) {
                    $font_css_array[ $value ] = [];
                }
                $font_css_array[ $value ][] = $selector;
                
                foreach ( $selector_arr as $selector_item ) {
                    $selector_to_value[ $selector_item ] = $value;
                }
                
                continue;
            }

            // now start analyze it,
            // value is like: Open Sans:400, 400i
            $explode = explode( ':', $value );
            $face = $explode[0];
            $styles = isset( $explode[1] ) ? $explode[1] : '';

            $face = str_replace('+', ' ', $face );
            $face = preg_replace( '/\s/', ' ', $face ); // replace all white spaces by simple white space
            $face = ucwords( $face ); // open sans ==> Open Sans
            
            // now we get font face
            $fontface = $face;
            
            if ( isset( $normal_fonts[ $fontface ] ) ) {
                
                $fontface = '"' . $normal_fonts[ $fontface ][ 'face' ] . '",' . $normal_fonts[ $fontface ][ 'category' ] ;
                
            } elseif ( isset( $google_fonts[ $fontface ] ) ) {
                
                $cat = $google_fonts[ $fontface ][ 'category' ];
                if ( 'handwriting' == $cat || 'display' == $cat ) {
                    $fallback = 'cursive';
                } else {
                    $fallback = $cat;
                }
                
                $fontface = '"' . $fontface . '",' . $fallback;
                
            }
        
        }
        
        // now assign it for reuse later
        $font_faces[ $id ] = $fontface;
        
        if ( ! isset( $font_css_array ) ) {
            $font_css_array[ $fontface ] = [];
        }
        $font_css_array[ $fontface ][] = $selector;
        
        foreach ( $selector_arr as $selector_item ) {
            $selector_to_value[ $selector_item ] = $fontface;
        }
        
        
    } // each ID
    
    $final_css_array = [];
    foreach ( $selector_to_value as $selector_item => $value ) {
        $face = '';
        if ( 'font_body' == $value ) {
            $face = isset( $selector_to_value[ '.font-body' ] ) ? $selector_to_value[ '.font-body' ] : '';
        } elseif ( 'font_heading' == $value ) {
            $face = isset( $selector_to_value[ '.font-heading' ] ) ? $selector_to_value[ '.font-heading' ] : '';
        } elseif ( 'font_nav' == $value ) {
            $face = isset( $selector_to_value[ '.font-nav' ] ) ? $selector_to_value[ '.font-nav' ] : '';
        } elseif ( 'font_special' == $value ) {
            $face = isset( $selector_to_value[ '.font-special' ] ) ? $selector_to_value[ '.font-special' ] : '';
        } else {
            $face = $value;
        }
        
        if ( ! isset( $final_css_array[ $face ] ) ) $final_css_array[ $face ] = [];
        $final_css_array[ $face ][] = $selector_item;
        
    }
    
    $css = '';
    foreach ( $final_css_array as $face => $selectors ) {
        $selectors = join( ',', $selectors );
        $css .= $selectors . '{font-family:' . $face . '}';
    }
    
    return [
        'css' => $css,
        '@font-face' => $font_face_rules,
    ];
    
}

/**
 * Typography Engine to generate typography correctly
 * this generates all typography values but font family
 * @since 3.3
 */
function dine_typography_output() {
    
    $all = dine_all_font_support();
    
    $ipad1 = dine_get_query_screen_string_from_text( 'ipad1' );
    $iphone1 = dine_get_query_screen_string_from_text( 'iphone1' );
    
    $media_query_arr = [
        'all' => [],
        $ipad1 => [],
        $iphone1 => [],
    ];
    
    foreach ( $all as $id => $fontdata ) {
        
        extract( wp_parse_args( $fontdata, [
            'selector' => '',
            'typo_selector' => '', // the selector only for typo, if set the selector will be skipped
            'typo' => '',
            'fields' => []
        ]  ) );
        
        if ( $typo_selector ) {
            $selector = $typo_selector;
        }
        if ( ! $selector ) continue;
        $typography = get_theme_mod( $id . '_typography', $typo );
        
        if ( ! $typography ) continue;
        
        try {
            $typography = json_decode( $typography, true );
        } catch ( Exception $err ) {
            $typography = [];
        }
        
        if ( ! $typography ) continue;
        
        $typography = wp_parse_args( $typography, [
            'font-size' => '',
            'font-size-tablet' => '',
            'font-size-phone' => '',
            
            'font-weight' => '',
            'font-style' => '',
            'text-transform' => '',
            'letter-spacing' => '',
            'line-height' => '',
        ] );
        
        foreach ( $typography as $prop => $val ) {
            
            $val = trim( $val );
            if ( '' === $val ) continue;
            
            // unit
            if ( in_array( $prop, [ 'font-size', 'font-size-tablet', 'font-size-phone', 'letter-spacing' ] ) ) {
                if ( is_numeric( $val ) ) $val .= 'px';
            }
            
            if ( 'font-size-tablet' == $prop ) {
                
                if ( ! isset( $media_query_arr[ $ipad1 ][ $selector ] ) ) {
                    $media_query_arr[ $ipad1 ][ $selector ] = [];
                }
                $media_query_arr[ $ipad1 ][ $selector ][] = 'font-size:' . $val;
                
            } elseif ( 'font-size-phone' == $prop ) {
                
                if ( ! isset( $media_query_arr[ $iphone1 ][ $selector ] ) ) {
                    $media_query_arr[ $iphone1 ][ $selector ] = [];
                }
                
                $media_query_arr[ $iphone1 ][ $selector ][] = 'font-size:' . $val;
            } else {
                
                if ( ! isset( $media_query_arr[ 'all' ][ $selector ] ) ) {
                    $media_query_arr[ 'all' ][ $selector ] = [];
                }
                
                $media_query_arr[ 'all' ][ $selector ][] = "{$prop}:{$val}";
            }
            
        }
    
    }
    
    $return = '';
    foreach ( $media_query_arr as $query => $css_pieces ) {
        $inner = '';
        foreach ( $css_pieces as $selector => $props ) {
            $inner .= $selector . '{' . join( ';', $props ) . '}';
        }
        if ( 'all' == $query ) {
            $return .= $inner;
        } else {
            $return .= $query . '{' . $inner . '}';
        }
    }
    
    return $return;
    
}

add_filter( 'dine_css', 'dine_add_typography_output', 0 );
function dine_add_typography_output( $css ) {
    
    $css .= dine_typography_output();
    return $css;
    
}

add_action( 'wp_enqueue_scripts', 'dine_customizer_style', 20 );
if ( ! function_exists( 'dine_customizer_style' ) ) :
/**
 * Prints inline style from Customizer
 *
 * @since 1.0
 */
function dine_customizer_style() {
    
    /**
     * Hook to append CSS
     */
    $css = '';
    
    $font_output = dine_css_font_output();
    
    // add font face first
    $css .= $font_output[ '@font-face' ];
    
    /* FONT PROBLEM
     * just add font css string
    --------------------- */
    $css .= $font_output[ 'css' ];
    
    /**
     * priorities:
     * dine_add_typography_output - 0
     * dine_accent_color_css - 5
     * dine_regular_css - 10
     * dine_misc_css - 20
     */
    $css = apply_filters( 'dine_css', $css );

    // attach it to <head />
    if ( ! wp_add_inline_style( 'dine-framework', $css ) ) {
        wp_add_inline_style( 'dine-style', $css );
    }

}
endif;

/**
 * filter css value
 * @since 3.1
 */
function dine_filter_css_value( $value, $property = '' ) {
    
    $unit_arrs = [ 'font-size', 'background-size', 'border-width', 'border-radius', 'border-top-right-radius', 'border-top-left-radius', 'border-bottom-right-radius', 'border-bottom-left-radius', 'margin', 'margin-top', 'margin-right','margin-bottom', 'margin-left', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', 'width', 'height', 'letter-spacing' ];
    
    $value = trim( $value ) ;
    if ( 'background-image' == $property ) {        
        
        $value = 'url(' . esc_url( $value ). ')';
        
    } elseif ( in_array( $property, $unit_arrs ) ) {
        
        if ( is_numeric( $value ) ) {
            $value .= 'px';
        }
        
    }
    
    return $value;
    
}

add_filter( 'dine_css', 'dine_regular_css', 10 );
/**
 * regular css
 * @since 3.1
 */
function dine_regular_css( $css ) {
    
    $options = Dine_Register::instance()->options();
    
    $css_arr = [];
    
    foreach ( $options as $k => $option ) {
        
        $selector = isset( $option['selector'] ) ? $option['selector'] : '';
        $property = isset( $option['css'] ) ? $option['css'] : '';
        $unit = isset( $option['unit'] ) ? $option['unit'] : '';
        $std = isset( $option['std'] ) ? $option['std'] : null;
        
        if ( ! $property || ! $selector ) continue;
        
        // we'll treat it later
        if ( 'font-family' == $property ) {
            continue;
        }
        
        $value = get_theme_mod( $k, $std );
        if ( '' == $value ) {
            continue;
        }
        if ( $unit && is_numeric( $value ) ) {
            $value = $value . $unit;
        }
        
        $value = dine_filter_css_value( $value, $property );
        
        if ( ! isset( $css_arr[ $selector ] ) ) {
            $css_arr[ $selector ] = [];
        }
        $css_arr[ $selector ][] = [ $property, $value ];
        
    }
    
    $css_pieces = [];
    foreach ( $css_arr as $selector => $pairs ) {
        
        $arr = [];
        foreach ( $pairs as $p ) {
            $arr[] = $p[0] . ':' . $p[1];
        }
        $css_pieces[] = dine_format( '{selector}{{pieces}}', [
            'selector' => $selector,
            'pieces' => join( ';', $arr ),
        ] );
        
    }
    
    $css .= join( "\n", $css_pieces );
    
    return $css;
    
}

/**
 * accent color css
 * @since 3.1
 */
function dine_accent_color_css( $css ) {
    
    $accent_selectors = dine_accent_selectors();
    $value = get_theme_mod( 'accent', '#ab3f1b' );
    $css_pieces = [];
    
    if ( isset( $accent_selectors[ 'color' ] ) && $accent_selectors[ 'color' ] ) {
        $css_pieces[] = dine_format( '{selector}{color:{value}}', [
            'selector' => $accent_selectors[ 'color' ],
            'value' => $value,
        ] );
    }
    
    if ( isset( $accent_selectors[ 'background' ] ) && $accent_selectors[ 'background' ] ) {
        $css_pieces[] = dine_format( '{selector}{background-color:{value}}', [
            'selector' => $accent_selectors[ 'background' ],
            'value' => $value,
        ] );
    }
    
    if ( isset( $accent_selectors[ 'border' ] ) && $accent_selectors[ 'border' ] ) {
        $css_pieces[] = dine_format( '{selector}{border-color:{value}}', [
            'selector' => $accent_selectors[ 'border' ],
            'value' => $value,
        ] );
    }
    
    $css .= join( "\n", $css_pieces );
    
    return $css;
    
}
add_filter( 'dine_css', 'dine_accent_color_css', 5 );

/**
 * misc css
 * @since 3.1
 */
function dine_misc_css( $css ) {
    
    $container = absint( get_theme_mod( 'container_width' ) );
    if ( $container > 0 ) {
        $css .= '@media only screen and (min-width: 1280px) {.container{width:' . $container . 'px;} body.layout-boxed #page {width:' . ( $container + 120 ) . 'px;}}'; // only laptop screen
    }
    
    // border width
    $border_width = absint( get_theme_mod( 'site_border_width', 0 ) );
    if ( $border_width > 10 ) {
        $css .= '@media only screen and (max-width: 1279px) {body{border-width:' . min( $border_width, 10 )  . 'px;}'; // only laptop screen
    }
    
    /**
     * logo width on devices
     * @since 3.3
     */
    $tablet_logo_w = absint( get_theme_mod( 'logo_width_tablet' ) );
    if ( $tablet_logo_w > 5 ) {
        $css .= dine_get_query_screen_string_from_text( 'ipad1' ) . '#logo img{width:' . $tablet_logo_w . 'px;}';
    }
    
    $phone_logo_w = absint( get_theme_mod( 'logo_width_phone' ) );
    if ( $phone_logo_w > 5 ) {
        $css .= dine_get_query_screen_string_from_text( 'iphone1' ) . '#logo img{width:' . $phone_logo_w . 'px;}';
    }
    
    /**
     * Header height on phone
     * @since 3.3
     */
    $header_height = absint( get_theme_mod( 'header_height_tablet' ) );
    if ( $header_height > 5 ) {
        $css .= dine_get_query_screen_string_from_text( 'ipad1' ) . '#masthead .container, #masthead-height{height:' . $header_height . 'px;}';
    }
    
    $header_height = absint( get_theme_mod( 'header_height_phone' ) );
    if ( $header_height > 5 ) {
        $css .= dine_get_query_screen_string_from_text( 'iphone1' ) . '#masthead .container, #masthead-height{height:' . $header_height . 'px;}';
    }
    
    
    return $css;
    
}
add_filter( 'dine_css', 'dine_misc_css', 20 );

if ( ! function_exists( 'dine_css_properties' ) ) :
/**
 * Returns array of css properties may we'll need to check it
 *
 * @since 1.0
 *
 * @return array of css properties 
 */
function dine_css_properties() {

    return array( 'color', 'background', 'background-color', 'background-image', 'background-position', 'background-size', 'background-repeat', 'background-attachment', 'border', 'border-style', 'border-color', 'border-width', 'border-radius', 'margin', 'padding', 'width', 'height', 'font-size', 'font-family', 'font-weight', 'font-style', 'text-transform', 'letter-spacing', 'text-decoration', 'text-align', 'line-height', 'box-shadow', 'opacity', 'transition', 'content', 'top', 'right', 'bottom', 'left' );
    
}
endif;

if ( ! function_exists( 'dine_unit_array' ) ) :
/**
 * Returns array of css properties having px as default unit
 *
 * @since 1.0
 */
function dine_unit_array() {
    
    return array( 'font-size', 'background-size', 'border-width', 'border-radius', 'border-top-right-radius', 'border-top-left-radius', 'border-bottom-right-radius', 'border-bottom-left-radius', 'margin', 'margin-top', 'margin-right','margin-bottom', 'margin-left', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', 'width', 'height', 'letter-spacing' );
    
}
endif;

if ( ! function_exists( 'dine_css_options' ) ) :
/**
 * Lists of css properties
 *
 * We'll render this function by tool 
 * so plz do not edit this function in your child theme
 *
 * @since 1.0
 */
function dine_css_options() {
    
    include get_template_directory() . '/inc/customizer/css-options.php';
    include get_template_directory() . '/inc/customizer/toggles.php';
    
    // list of elements will be ignored by toggle conditional
    $ignores = array();
    
    $options = array();
    
    foreach ( $toggles as $id => $option ) {
        
        $toggle = $option[ 'toggle' ];
        $choices = $option[ 'options' ];
        
        $real_value = get_theme_mod( $id );
        if ( '' == $real_value && isset( $option[ 'std' ] ) ) $real_value = $option[ 'std' ];
        
        $not_exclude = array();
        if ( isset( $toggle[ $real_value ] ) ) {
            $not_exclude = $toggle[ $real_value ];
            if ( is_string( $not_exclude ) ) $not_exclude = array( $not_exclude );
        }

        foreach ( $toggle as $val => $dependent_elements ) {

            // don't care about real value
            if ( $val === $real_value ) continue;

            if ( is_string( $dependent_elements ) ) $dependent_elements = array( $dependent_elements );
            foreach ( $dependent_elements as $dependent_element ) {

                // not intersect with the real value
                if ( ! in_array( $dependent_element, $not_exclude ) ) {
                    $ignores[] = $dependent_element;
                }

            }
        }
    
    }
    
    foreach ( $reg_options as $id => $option ) {
        
        if ( in_array( $id, $ignores ) ) continue;
        
        $options[ $id ] = $option;
    }
    
    return $options;
    
}
endif;

/**
 * Singular CSS
 *
 * @since 1.0
 */
add_action( 'wp_head', 'dine_page_css', 1000 );
if ( ! function_exists( 'dine_page_css' ) ):
/**
 * Page CSS based on metaboxes
 *
 * @since 1.0
 */
function dine_page_css() {
    
    $postid = null;
    $postid = dine_pageid();
    
    if ( ! $postid ) return;
    
    $options = array(
        'padding_top' => array(
            'property' => 'padding-top',
            'selector' => 'body #page-wrapper #primary, body #page-wrapper #secondary',
            'unit' => 'px',
        ),
        'padding_bottom' => array(
            'property' => 'padding-bottom',
            'selector' => 'body #page-wrapper #primary, body #page-wrapper #secondary',
            'unit' => 'px',
        ),
    );
    ?>
<style>
    
    <?php foreach ( $options as $id => $option ) : 
    extract( wp_parse_args( $option, array(
        'property' => '',
        'selector' => '',
        'unit' => '',
    ) ) );
    
    $value = trim ( get_post_meta( $postid, '_dine_' . $id, true ) ) ;
    if ( '' != $value ) {
    
        if ( $unit && is_numeric( $value ) ) 
            $value .= $unit;
        
        echo "{$selector}{{$property}:{$value};}";
    
    }
    endforeach; ?>

</style>

<?php
}
endif;

if ( ! function_exists( 'dine_body_selector' )  ) :
/**
 * Body Selector
 *
 * @since 3.0
 */
function dine_body_selector() {
    
    return apply_filters( 'dine_body_selector', '.font-body, body, input, select, textarea, .dine-nice-select a' );
    
}
endif;

if ( ! function_exists( 'dine_heading_selector' )  ) :
/**
 * Heading Selector
 *
 * @since 3.0
 */
function dine_heading_selector() {
    
    return apply_filters( 'dine_heading_selector', '.font-heading, .woocommerce ul.cart_list li a, .woocommerce ul.product_list_widget li a, .woocommerce .widget_layered_nav ul li span, .woocommerce span.onsale, .woocommerce ul.products li.product .onsale, .woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce a.added_to_cart, .woocommerce nav.woocommerce-pagination ul, .woocommerce div.product .woocommerce-tabs ul.tabs li a, .woocommerce #reviews #comments ol.commentlist li .comment-text p.meta strong[itemprop="author"], .woocommerce table.shop_table th, .woocommerce table.shop_table td.product-name a, .woocommerce-MyAccount-navigation ul a, h1, h2, h3, h4, h5, h6, .dine-list li, th, .dine-btn, a.follow-us, button, input[type="button"], input[type="reset"], input[type="submit"], .text-logo, .header-cta a, .entry-meta, a.more-link, .entry-tags, .dine-pagination, .page-links, .comment-meta .comment-author .fn, .reply, #respond p label, .widget_archive ul a:not(.url), .widget_categories ul a:not(.url), .widget_nav_menu ul a:not(.url), .widget_meta ul a:not(.url), .widget_pages ul a:not(.url), .widget_recent_entries ul a:not(.url), .widget_recent_comments ul a:not(.url), .widget_product_categories ul a:not(.url), .widget_layered_nav ul a:not(.url), .tagcloud, #scrollup, body .rtb-booking-form fieldset > legend, body .rtb-booking-form .add-message a, body .picker__header, body .picker__weekday, body .picker__day, body .picker__list, #offcanvas .topbar-text, .counter-number, .menu-item-price, #ui-datepicker-div .ui-widget-header, .testimonial-content' );

}
endif;

if ( ! function_exists( 'dine_text_slider_selector' )  ) :
/**
 * Heading Selector
 *
 * @since 3.0
 */
function dine_text_slider_selector() {
    
    return dine_special_selector();
    
}
endif;

if ( ! function_exists( 'dine_special_selector' )  ) :
/**
 * Special Selector
 * @since 3.3
 */
function dine_special_selector() {
    
    return apply_filters( 'dine_special_selector', '.font-special, .carousel-cell-caption h3, .cd-headline' );
    
}
endif;

if ( ! function_exists( 'dine_nav_selector' )  ) :
/**
 * Navigation Selector
 *
 * @since 3.0
 */
function dine_nav_selector() {
    
    return apply_filters( 'dine_nav_selector', '.font-nav, #nav > li > a, .offcanvas-nav' );
    
}
endif; 

if ( ! function_exists( 'dine_nav_dropdown_selector' )  ) :
/**
 * Dropdown Selector
 *
 * @since 3.0
 */
function dine_nav_dropdown_selector() {
    
    return apply_filters( 'dine_nav_dropdown_selector', '#nav ul a' );
    
}
endif; 

if ( ! function_exists( 'dine_accent_selectors' )  ) :
/**
 * accent color selector
 * @since 3.1
 */
function dine_accent_selectors() {
    
    return apply_filters( 'dine_accent_selector', array(
                
        // color
        'color' => '.header-cart a:hover, .woocommerce .star-rating span:before, a, #nav > li > a:hover, #nav > li.active > a, #nav > li.current-menu-item > a, #nav > li.current-menu-ancestor > a, .tagcloud a:hover, #footer-sidebar .tagcloud a:hover, body .rtb-booking-form .add-message a:hover, .offcanvas-nav .menu > ul > li.current-menu-item > a, .offcanvas-nav .menu > ul > li.current-menu-ancestor > a, .offcanvas-nav .menu > ul > li.active > a, .offcanvas-nav .menu > ul ul > li:hover > a, .offcanvas-nav .menu > ul ul > li.current-menu-item > a, .offcanvas-nav .menu > ul ul > li.current-menu-ancestor > a, .counter-number, .testimonial-rating span:before, a.more-link',

        // background color
        'background' => 'button.mfp-arrow:hover, .woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle, .woocommerce span.onsale, .woocommerce ul.products li.product .onsale, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce a.add_to_cart_button:hover, .woocommerce #review_form #respond .form-submit input:hover, .dine-btn, a.follow-us, button, input[type="button"], input[type="reset"], input[type="submit"], .sticky .sticky-label, .bypostauthor .comment-author .fn, #scrollup a, input.wpcf7-submit[type="submit"]:hover, body .picker--focused .picker__day--selected, body .picker__day--selected, body .picker__day--selected:hover, body .picker__footer button:hover, body .picker__footer button:focus, body .picker__footer button:active, body .picker--focused .picker__list-item--selected, body .picker__list-item--selected, body .picker__list-item--selected:hover, .offcanvas-social .social-list a, .dine-menu-item.highlighted .menu-item-inner, #ui-datepicker-div .ui-state-highlight, #ui-datepicker-div .ui-widget-content .ui-state-highlight, #ui-datepicker-div .ui-widget-header .ui-state-highlight, .dine-testimonials .flex-control-paging li a:hover, .dine-testimonials .flex-control-paging li a.flex-active, .mejs-controls .mejs-time-rail .mejs-time-current, a.more-link:hover',

        // border color
        'border' => 'blockquote, button.mfp-arrow:hover, body .picker__day--highlighted, body .picker__footer button:hover, body .picker__footer button:focus, body .picker__footer button:active, body .picker--focused .picker__list-item--selected, body .picker__list-item--selected, body .picker__list-item--selected:hover, a.more-link',
    ) );
    
}
endif;


/**
 * Body Class
 * @since 3.0
 */
add_filter( 'body_class', 'dine_body_class' );
function dine_body_class( $classes ) {
    
    // site layout
    $site_layout = get_theme_mod( 'site_layout', 'wide' );
    if ( 'wide' != $site_layout ) $site_layout = 'boxed';
    $classes[] = 'layout-' . $site_layout;
    
    // clean header
    $clean_titlebar = get_theme_mod( 'clean_titlebar', 'false' );
    if ( 'true' == $clean_titlebar ) $classes[] = 'clean-titlebar';
    
    // form style
    // since 3.1
    $form_style = get_theme_mod( 'form_style', 'classic' );
    if ( ! in_array( $form_style, [ 'modern', 'gentle', 'strong' ] ) ) {
        $form_style = 'classic';
    }
    $classes[] = 'style--form-' . $form_style;
    
    return $classes;
    
}

Youez - 2016 - github.com/yon3zu
LinuXploit