grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 50; } } if( ! function_exists( 'woodmart_get_blog_shortcode_ajax' ) ) { function woodmart_get_blog_shortcode_ajax() { if( ! empty( $_POST['atts'] ) ) { $atts = woodmart_clean( $_POST['atts'] ); $paged = ( empty( $_POST['paged'] ) ) ? 2 : sanitize_text_field( (int) $_POST['paged'] ) + 1; $atts['ajax_page'] = $paged; if ( $atts['elementor'] ) { $data = woodmart_elementor_blog_template( $atts ); } else { $data = woodmart_shortcode_blog( $atts ); } echo json_encode( $data ); die(); } } add_action( 'wp_ajax_woodmart_get_blog_shortcode', 'woodmart_get_blog_shortcode_ajax' ); add_action( 'wp_ajax_nopriv_woodmart_get_blog_shortcode', 'woodmart_get_blog_shortcode_ajax' ); } if( ! function_exists( 'woodmart_get_portfolio_shortcode_ajax' ) ) { function woodmart_get_portfolio_shortcode_ajax() { if( ! empty( $_POST['atts'] ) ) { $atts = woodmart_clean( $_POST['atts'] ); $paged = (empty($_POST['paged'])) ? 2 : sanitize_text_field( (int) $_POST['paged'] ) + 1; $atts['ajax_page'] = $paged; if ( $atts['elementor'] ) { $data = woodmart_elementor_portfolio_template( $atts ); } else { $data = woodmart_shortcode_portfolio( $atts ); } echo json_encode( $data ); die(); } } add_action( 'wp_ajax_woodmart_get_portfolio_shortcode', 'woodmart_get_portfolio_shortcode_ajax' ); add_action( 'wp_ajax_nopriv_woodmart_get_portfolio_shortcode', 'woodmart_get_portfolio_shortcode_ajax' ); } if ( ! function_exists( 'woodmart_get_color_value' ) ) { function woodmart_get_color_value( $key, $default ) { $color = woodmart_get_opt( $key ); if ( isset( $color['idle'] ) && $color['idle'] ) { return $color['idle']; } else { return $default; } } } if ( ! function_exists( 'woodmart_get_css_animation' ) ) { function woodmart_get_css_animation( $css_animation ) { $output = ''; if ( $css_animation && $css_animation != 'none' ) { wp_enqueue_style( 'animate-css' ); wp_enqueue_style( 'vc_animate-css' ); $output = ' wpb_animate_when_almost_visible wpb_' . $css_animation . ' ' . $css_animation; } return $output; } } if( ! function_exists( 'woodmart_get_user_panel_params' ) ) { function woodmart_get_user_panel_params() { return apply_filters( 'woodmart_get_user_panel_params', array( array( 'type' => 'textfield', 'heading' => esc_html__( 'Title', 'woodmart' ), 'param_name' => 'title', ) )); } } if( ! function_exists( 'woodmart_vc_get_link_attr' ) ) { function woodmart_vc_get_link_attr( $link ) { $link = ( '||' === $link ) ? '' : $link; $link = woodmart_vc_build_link( $link ); return $link; } } if( ! function_exists( 'woodmart_get_link_attributes' ) ) { function woodmart_get_link_attributes( $link, $popup = false ) { //parse link $link = woodmart_vc_get_link_attr( $link ); $use_link = false; if ( isset( $link['url'] ) && strlen( $link['url'] ) > 0 ) { $use_link = true; $a_href = apply_filters( 'woodmart_extra_menu_url', $link['url'] ); if ( $popup ) $a_href = $link['url']; $a_title = $link['title']; $a_target = $link['target']; } $attributes = array(); if ( $use_link ) { $attributes[] = 'href="' . trim( $a_href ) . '"'; $attributes[] = 'title="' . esc_attr( trim( $a_title ) ) . '"'; if ( ! empty( $a_target ) ) { $attributes[] = 'target="' . esc_attr( trim( $a_target ) ) . '"'; } } $attributes = implode( ' ', $attributes ); return $attributes; } } if ( ! function_exists( 'woodmart_get_taxonomies_by_ids_autocomplete' ) ) { /** * Autocomplete by taxonomies ids. * * @since 1.0.0 * * @param array $ids Posts ids. * * @return array */ function woodmart_get_taxonomies_by_ids_autocomplete( $ids ) { $output = array(); if ( ! $ids ) { return $output; } if ( ! is_array( $ids ) ) { $ids = array( $ids ); } foreach ( $ids as $id ) { $term = get_term( $id ); if ( $term ) { $output[ $term->term_id ] = array( 'name' => $term->name, 'value' => $term->term_id, ); } } return $output; } } if ( ! function_exists( 'woodmart_get_taxonomies_by_query_autocomplete' ) ) { /** * Autocomplete by taxonomies. * * @since 1.0.0 */ function woodmart_get_taxonomies_by_query_autocomplete() { $output = array(); $args = array( 'number' => 5, 'taxonomy' => $_POST['value'], // phpcs:ignore 'search' => $_POST['params']['term'], // phpcs:ignore ); $terms = get_terms( $args ); if ( count( $terms ) > 0 ) { // phpcs:ignore foreach ( $terms as $term ) { $output[] = array( 'id' => $term->term_id, 'text' => $term->name, ); } } echo wp_json_encode( $output ); die(); } add_action( 'wp_ajax_woodmart_get_taxonomies_by_query_autocomplete', 'woodmart_get_taxonomies_by_query_autocomplete' ); add_action( 'wp_ajax_nopriv_woodmart_get_taxonomies_by_query_autocomplete', 'woodmart_get_taxonomies_by_query_autocomplete' ); } // **********************************************************************// // ! Body classes // **********************************************************************// if ( ! function_exists( 'xts_get_default_value' ) ) { /** * Get default theme settings value * * @since 1.0.0 * * @param string $key Value key. * * @return string */ function xts_get_default_value( $key ) { // $default_values = xts_get_config( 'framework-defaults' ); // $theme_values = xts_get_config( 'theme-defaults' ); // if ( $theme_values ) { // $default_values = wp_parse_args( $theme_values, $default_values ); // } return ''; return isset( $default_values[ $key ] ) ? $default_values[ $key ] : ''; } } if ( ! function_exists( 'woodmart_product_attributes_array' ) ) { function woodmart_product_attributes_array() { if ( ! function_exists( 'wc_get_attribute_taxonomies' ) ) { return; } $attributes = array(); foreach ( wc_get_attribute_taxonomies() as $attribute ) { $attributes[ 'pa_' . $attribute->attribute_name ] = array( 'name' => $attribute->attribute_label, 'value' => 'pa_' . $attribute->attribute_name, ); } return $attributes; } } if ( ! function_exists( 'woodmart_get_pages_array' ) ) { /** * Get all pages array * * @since 1.0.0 * * @return array */ function woodmart_get_pages_array() { $pages = array(); foreach ( get_pages() as $page ) { $pages[ $page->ID ] = array( 'name' => $page->post_title, 'value' => $page->ID, ); } return $pages; } } if( ! function_exists( 'woodmart_body_class' ) ) { function woodmart_body_class( $classes ) { $page_id = woodmart_page_ID(); $site_width = woodmart_get_opt( 'site_width' ); $product_design = woodmart_product_design(); $product_sticky = woodmart_product_sticky(); $ajax_shop = woodmart_get_opt( 'ajax_shop' ); $hide_sidebar_mobile = woodmart_get_opt( 'shop_hide_sidebar' ); $hide_sidebar_tablet = woodmart_get_opt( 'shop_hide_sidebar_tablet' ); $hide_sidebar_desktop = woodmart_get_opt( 'shop_hide_sidebar_desktop' ); $catalog_mode = woodmart_get_opt( 'catalog_mode' ); $categories_toggle = woodmart_get_opt( 'categories_toggle' ); $sticky_footer = woodmart_get_opt( 'sticky_footer' ); $dark = woodmart_get_opt( 'dark_version' ); $form_fields_style = ( woodmart_get_opt( 'form_fields_style' ) ) ? woodmart_get_opt( 'form_fields_style' ) : 'square'; $form_border_width = woodmart_get_opt( 'form_border_width' ); $single_post_design = woodmart_get_opt( 'single_post_design' ); $main_sidebar_mobile = woodmart_get_opt( 'hide_main_sidebar_mobile' ); if ( $single_post_design == 'large_image' && is_single() ) { $classes[] = 'single-post-large-image'; } $classes[] = 'wrapper-' . $site_width; // Form style settings $classes[] = 'form-style-' . $form_fields_style; $classes[] = 'form-border-width-' . $form_border_width; if( is_singular( 'product' ) ) { $classes[] = 'woodmart-product-design-' . $product_design; if( $product_sticky ) { $classes[] = 'woodmart-product-sticky-on'; woodmart_enqueue_script( 'woodmart-sticky-kit' ); } } if ( woodmart_woocommerce_installed() && ( is_shop() || is_product_category() ) && ( $hide_sidebar_desktop && $sticky_footer ) ) { $classes[] = 'no-sticky-footer'; }elseif( $sticky_footer ){ $classes[] = 'sticky-footer-on'; } if ( $dark ) { $classes[] = 'woodmart-dark'; } if ( $catalog_mode ) { $classes[] = 'catalog-mode-on'; } if ( $categories_toggle ) { $classes[] = 'categories-accordion-on'; } if( woodmart_is_blog_archive() ) { $classes[] = 'woodmart-archive-blog'; } else if( woodmart_is_shop_archive() ) { $classes[] = 'woodmart-archive-shop'; } else if( woodmart_is_portfolio_archive() ) { $classes[] = 'woodmart-archive-portfolio'; } //Header banner if ( ! woodmart_get_opt( 'header_close_btn' ) && woodmart_get_opt( 'header_banner' ) && ! woodmart_maintenance_page() ) { $classes[] = 'header-banner-display'; } if ( woodmart_get_opt( 'header_banner' ) && ! woodmart_maintenance_page() ) { $classes[] = 'header-banner-enabled'; } if ( $ajax_shop ) { $classes[] = 'woodmart-ajax-shop-on'; } if( $hide_sidebar_mobile && ( woodmart_woocommerce_installed() && ( is_shop() || is_product_category() || is_product_tag() || woodmart_is_product_attribute_archieve() ) ) || $main_sidebar_mobile && ( ! woodmart_woocommerce_installed() || ( ! is_shop() && ! is_product_category() && ! is_product_tag() && ! woodmart_is_product_attribute_archieve() ) ) ) { $classes[] = 'offcanvas-sidebar-mobile'; } if( $hide_sidebar_tablet ) { $classes[] = 'offcanvas-sidebar-tablet'; } if( $hide_sidebar_desktop ) { $classes[] = 'offcanvas-sidebar-desktop'; } if ( ! is_user_logged_in() && woodmart_get_opt( 'login_prices' ) ) { $classes[] = 'login-see-prices'; } if ( woodmart_get_opt( 'disable_nanoscroller' ) != 'enable' ) { $classes[] = 'disabled-nanoscroller'; } if ( woodmart_get_opt( 'sticky_notifications' ) ) { $classes[] = 'notifications-sticky'; } if ( woodmart_get_opt( 'sticky_toolbar' ) ) { $classes[] = 'sticky-toolbar-on'; } if ( woodmart_get_opt( 'hide_larger_price' ) ) { $classes[] = 'hide-larger-price'; } $classes = array_merge( $classes, woodmart_get_buttons_config_classes(), woodmart_get_header_body_classes() ); return $classes; } add_filter('body_class', 'woodmart_body_class'); } /** * ------------------------------------------------------------------------------------------------ * Get header body classes * ------------------------------------------------------------------------------------------------ */ if ( ! function_exists( 'woodmart_get_header_body_classes' ) ) { function woodmart_get_header_body_classes() { $classes = array(); $settings = whb_get_settings(); if ( isset( $settings['overlap'] ) && $settings['overlap'] ) { $classes[] = 'woodmart-header-overcontent'; } if ( whb_get_dropdowns_color() == 'light' ) { $classes[] = 'dropdowns-color-light'; } return $classes; } } /** * ------------------------------------------------------------------------------------------------ * Buttons configuration classes * ------------------------------------------------------------------------------------------------ */ if( ! function_exists( 'woodmart_get_buttons_config_classes' ) ) { function woodmart_get_buttons_config_classes() { $classes = array(); $classes[] = 'btns-default-' . woodmart_get_opt( 'btns_default_style' ); $classes[] = 'btns-default-' . woodmart_get_opt( 'btns_default_color_scheme' ); $classes[] = 'btns-default-hover-' . woodmart_get_opt( 'btns_default_color_scheme_hover' ); $classes[] = 'btns-shop-' . woodmart_get_opt( 'btns_shop_style' ); $classes[] = 'btns-shop-' . woodmart_get_opt( 'btns_shop_color_scheme' ); $classes[] = 'btns-shop-hover-' . woodmart_get_opt( 'btns_shop_color_scheme_hover' ); $classes[] = 'btns-accent-' . woodmart_get_opt( 'btns_accent_style' ); $classes[] = 'btns-accent-' . woodmart_get_opt( 'btns_accent_color_scheme' ); $classes[] = 'btns-accent-hover-' . woodmart_get_opt( 'btns_accent_color_scheme_hover' ); return $classes; } } /** * ------------------------------------------------------------------------------------------------ * Filter wp_title * ------------------------------------------------------------------------------------------------ */ if( ! function_exists( 'woodmart_wp_title' ) ) { function woodmart_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( esc_html__( 'Page %s', 'woodmart' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'woodmart_wp_title', 10, 2 ); } /** * ------------------------------------------------------------------------------------------------ * Get predefined footer configuration by index * ------------------------------------------------------------------------------------------------ */ if( ! function_exists( 'woodmart_get_footer_config' ) ) { function woodmart_get_footer_config( $index ) { if( $index > 20 || $index < 1) { $index = 1; } $configs = apply_filters( 'woodmart_footer_configs_array', array( 1 => array( 'cols' => array( 'col-12' ), ), 2 => array( 'cols' => array( 'col-12 col-sm-6', 'col-12 col-sm-6', ), ), 3 => array( 'cols' => array( 'col-12 col-sm-4', 'col-12 col-sm-4', 'col-12 col-sm-4', ), ), 4 => array( 'cols' => array( 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', ), ), 5 => array( 'cols' => array( 'col-12 col-sm-6 col-md-4 col-lg-2', 'col-12 col-sm-6 col-md-4 col-lg-2', 'col-12 col-sm-6 col-md-4 col-lg-2', 'col-12 col-sm-6 col-md-4 col-lg-2', 'col-12 col-sm-6 col-md-4 col-lg-2', 'col-12 col-sm-6 col-md-4 col-lg-2', ), ), 6 => array( 'cols' => array( 'col-12 col-sm-4 col-lg-3', 'col-12 col-sm-4 col-lg-6', 'col-12 col-sm-4 col-lg-3', ), ), 7 => array( 'cols' => array( 'col-12 col-sm-4 col-lg-6', 'col-12 col-sm-4 col-lg-3', 'col-12 col-sm-4 col-lg-3', ), ), 8 => array( 'cols' => array( 'col-12 col-sm-4 col-lg-3', 'col-12 col-sm-4 col-lg-3', 'col-12 col-sm-4 col-lg-6', ), ), 9 => array( 'cols' => array( 'col-12', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', ), ), 10 => array( 'cols' => array( 'col-12 col-md-6', 'col-12 col-md-6', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', ), ), 11 => array( 'cols' => array( 'col-12 col-md-6', 'col-12 col-md-6', 'col-12 col-sm-6 col-md-3 col-lg-2', 'col-12 col-sm-6 col-md-3 col-lg-2', 'col-12 col-sm-6 col-md-3 col-lg-2', 'col-12 col-sm-6 col-md-3 col-lg-2', 'col-12 col-lg-4', ), ), 12 => array( 'cols' => array( 'col-12', 'col-12 col-sm-6 col-md-3 col-lg-2', 'col-12 col-sm-6 col-md-3 col-lg-2', 'col-12 col-sm-6 col-md-3 col-lg-2', 'col-12 col-sm-6 col-md-3 col-lg-2', 'col-12 col-lg-4', ), ), 13 => array( 'cols' => array( 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-6 col-lg-3', 'col-12 col-sm-4 col-lg-2', 'col-12 col-sm-4 col-lg-2', 'col-12 col-sm-4 col-lg-2', ), ), ) ); return (isset( $configs[$index] )) ? $configs[$index] : array(); } } // **********************************************************************// // ! Theme 3d plugins // **********************************************************************// if(!defined('YITH_REFER_ID')) { define('YITH_REFER_ID', '1040314'); } if( ! function_exists( 'woodmart_3d_plugins' )) { function woodmart_3d_plugins() { if( function_exists( 'set_revslider_as_theme' ) ){ set_revslider_as_theme(); } } add_action( 'init', 'woodmart_3d_plugins' ); } if( ! function_exists( 'woodmart_vcSetAsTheme' ) ) { function woodmart_vcSetAsTheme() { if( function_exists( 'vc_set_as_theme' ) ){ vc_set_as_theme(); } } add_action( 'vc_before_init', 'woodmart_vcSetAsTheme' ); } // **********************************************************************// // ! Obtain real page ID (shop page, blog, portfolio or simple page) // **********************************************************************// /** * This function is called once when initializing WOODMART_Layout object * then you can use function woodmart_page_ID to get current page id */ if( ! function_exists( 'woodmart_get_the_ID' ) ) { function woodmart_get_the_ID( $args = array() ) { global $post; $page_id = 0; $page_for_posts = get_option( 'page_for_posts' ); $page_for_shop = get_option( 'woocommerce_shop_page_id' ); $page_for_projects = woodmart_tpl2id( 'portfolio.php' ); $custom_404_id = woodmart_get_opt( 'custom_404_page' ); if(isset($post->ID)) $page_id = $post->ID; if( isset($post->ID) && ( is_singular( 'page' ) || is_singular( 'post' ) ) ) { $page_id = $post->ID; } else if( is_home() || is_singular( 'post' ) || is_search() || is_tag() || is_category() || is_date() || is_author() ) { $page_id = $page_for_posts; } else if( is_archive() && get_post_type() == 'portfolio' ) { $page_id = $page_for_projects; } if( woodmart_woocommerce_installed() && function_exists( 'is_shop' ) ) { if( isset( $args['singulars'] ) && in_array( 'product', $args['singulars']) && is_singular( "product" ) ) { // keep post id } else if( is_shop() || is_product_category() || is_product_tag() || is_singular( "product" ) || woodmart_is_product_attribute_archieve() ) { $page_id = $page_for_shop; } } if( is_404() && ( $custom_404_id != 'default' || ! empty( $custom_404_id ) ) ) $page_id = $custom_404_id; return $page_id; } } // **********************************************************************// // ! Function to get HTML block content // **********************************************************************// if( ! function_exists( 'woodmart_get_html_block' ) ) { function woodmart_get_html_block($id) { $post = get_post( $id ); if ( ! $post || $post->post_type != 'cms_block' ) return; if ( woodmart_is_elementor_installed() && Plugin::$instance->db->is_built_with_elementor( $id ) ) { $content = woodmart_elementor_get_content( $id ); } else { $content = do_shortcode( $post->post_content ); $shortcodes_custom_css = get_post_meta( $id, '_wpb_shortcodes_custom_css', true ); $woodmart_shortcodes_custom_css = get_post_meta( $id, 'woodmart_shortcodes_custom_css', true ); $content .= ''; } return $content; } } if( ! function_exists( 'woodmart_get_static_blocks_array' ) ) { function woodmart_get_static_blocks_array( $new = false ) { $args = array( 'posts_per_page' => 500, 'post_type' => 'cms_block' ); $blocks_posts = get_posts( $args ); $array = array(); foreach ( $blocks_posts as $post ) : setup_postdata( $post ); if ( $new ) { $array[ $post->ID ] = array( 'name' => $post->post_title, 'value' => $post->ID, ); } else { $array[ $post->post_title ] = $post->ID; } endforeach; wp_reset_postdata(); return $array; } } if ( ! function_exists( 'woodmart_get_html_blocks_array' ) ) { /** * Function to get array of HTML Blocks * * @since 1.0.0 * * @return array */ function woodmart_get_elementor_html_blocks_array() { $output = array(); $posts = get_posts( array( 'posts_per_page' => 500, // phpcs:ignore 'post_type' => 'cms_block', ) ); $output['0'] = esc_html__( 'Select', 'xts-theme' ); foreach ( $posts as $post ) { setup_postdata( $post ); $output[ $post->ID ] = $post->post_title; } wp_reset_postdata(); return $output; } } // **********************************************************************// // ! Set excerpt length and more btn // **********************************************************************// add_filter( 'excerpt_length', 'woodmart_excerpt_length', 999 ); if( ! function_exists( 'woodmart_excerpt_length' ) ) { function woodmart_excerpt_length( $length ) { return 20; } } add_filter('excerpt_more', 'woodmart_new_excerpt_more'); if( ! function_exists( 'woodmart_new_excerpt_more' ) ) { function woodmart_new_excerpt_more( $more ) { return ''; } } // **********************************************************************// // ! Add scroll to top buttom // **********************************************************************// add_action( 'woodmart_after_footer', 'woodmart_scroll_top_btn' ); if( ! function_exists( 'woodmart_scroll_top_btn' ) ) { function woodmart_scroll_top_btn( $more ) { if( !woodmart_get_opt( 'scroll_top_btn' ) ) return; ?> term_id; $args = array( 'tag__in' => $tax_ids, 'post__not_in' => array( $post_id ), 'showposts' => 12, 'ignore_sticky_posts' => 1 ); } return $args; } } // **********************************************************************// // ! Navigation walker // **********************************************************************// if( ! class_exists( 'WOODMART_Mega_Menu_Walker' )) { class WOODMART_Mega_Menu_Walker extends Walker_Nav_Menu { private $color_scheme = 'dark'; public function __construct() { $this->color_scheme = whb_get_dropdowns_color(); } /** * Starts the list before the elements are added. * * @see Walker::start_lvl() * * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of arguments. @see wp_nav_menu() */ public function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat("\t", $depth); if( $depth == 0) { $output .= "\n$indent
\n"; } } /** * Start the element output. * * @see Walker::start_el() * * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of arguments. @see wp_nav_menu() * @param int $id Current item ID. */ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $classes[] = 'menu-item-' . $item->ID; $classes[] = 'item-level-' . $depth; $design = $width = $height = $icon = $label = $label_out = ''; $design = get_post_meta( $item->ID, '_menu_item_design', true ); $width = get_post_meta( $item->ID, '_menu_item_width', true ); $height = get_post_meta( $item->ID, '_menu_item_height', true ); $icon = get_post_meta( $item->ID, '_menu_item_icon', true ); $event = get_post_meta( $item->ID, '_menu_item_event', true ); $label = get_post_meta( $item->ID, '_menu_item_label', true ); $label_text = get_post_meta( $item->ID, '_menu_item_label-text', true ); $block = get_post_meta( $item->ID, '_menu_item_block', true ); $dropdown_ajax = get_post_meta( $item->ID, '_menu_item_dropdown-ajax', true ); $opanchor = get_post_meta( $item->ID, '_menu_item_opanchor', true ); $callbtn = get_post_meta( $item->ID, '_menu_item_callbtn', true ); $color_scheme = get_post_meta( $item->ID, '_menu_item_colorscheme', true ); if ( $color_scheme == 'light' ) { $this->color_scheme = 'light'; }elseif( $color_scheme == 'dark' ){ $this->color_scheme = 'dark'; } if( empty($design) ) $design = 'default'; if ( ! is_object( $args ) ) return; if( $depth == 0 && $args->menu_class != 'site-mobile-menu' ) { $classes[] = 'menu-item-design-' . $design; $classes[] = 'menu-' . ( ( in_array( $design, array( 'sized', 'full-width' ) ) ) ? 'mega-dropdown' : 'simple-dropdown' ); $event = (empty($event)) ? 'hover' : $event; $classes[] = 'item-event-' . $event; } if ( $block && $args->menu_class == 'site-mobile-menu' ) { $classes[] = 'menu-item-has-block'; } if( $opanchor == 'enable' ) { $classes[] = 'onepage-link'; if(($key = array_search('current-menu-item', $classes)) !== false) { unset($classes[$key]); } } if( $callbtn == 'enable' ) { $classes[] = 'callto-btn'; } if( !empty( $label ) ) { $classes[] = 'item-with-label'; $classes[] = 'item-label-' . $label; $label_out = ''; } if( ! empty( $block ) && $design != 'default' ) { $classes[] = 'menu-item-has-children'; } if( $dropdown_ajax == 'yes') { $classes[] = 'dropdown-load-ajax'; } if ( $height && $design == 'sized' ) { $classes[] = 'dropdown-with-height'; } /** * Filter the CSS class(es) applied to a menu item's list item element. * * @since 3.0.0 * @since 4.1.0 The `$depth` parameter was added. * * @param array $classes The CSS classes that are applied to the menu item's `