theme_location === 'primary') { $items .= ''; } return $items; } endif; add_filter('wp_nav_menu_items', 'rox_search_menu_icon', 10, 2); /*---------------------------------------------------------------------- * Function for mobile menu icon *----------------------------------------------------------------------*/ if (!function_exists('rox_mobile_icon')) { function rox_mobile_icon() { /* * Function Name : rox_mobile_icon * Description : Function to show mobile menu , Applied in master head * Function Hooked : rox_master_head * Function return Type : html * Function Since : 1.0.0 */ $mobile_iocn_grid = rox_get_mod('layout_header_menu_mobileshow'); switch ($mobile_iocn_grid) { case 'sm': $mobile_iocn_grid = ' d-block d-md-none'; break; case 'md': $mobile_iocn_grid = ' d-block d-lg-none'; break; case 'lg': $mobile_iocn_grid = ' d-block d-xl-none'; break; case 'xl': $mobile_iocn_grid = ' d-block'; break; default: $mobile_iocn_grid = ' d-block d-xl-none'; }; ob_start() ?>
'mobile')); } else { wp_nav_menu(array('theme_location' => 'primary', 'mobile' => true)); } $output = ob_get_clean(); return $output; } } /*---------------------------------------------------------------------- * Right Nav panel *----------------------------------------------------------------------*/ if (!function_exists('rox_header_user_account_info')) { /* * Function Name : rox_right_nav_panel * Description : Function For Right Panel * Function Hooked : NA * Function return Type : html output * Function Since : rox_site */ function rox_header_user_account_info() { ?> 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '' ); $args = wp_parse_args($args, $defaults); /** * Filter the arguments used to generate a page-based menu. * * @since 2.7.0 * * @see wp_page_menu() * * @param array $args An array of page menu arguments. */ $args = apply_filters('wp_page_menu_args', $args); $menu = ''; $list_args = $args; // Show Home in the menu if (!empty($args['show_home'])) { if (true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home']) { $text = __('Home', 'ayyash'); } else { $text = $args['show_home']; } $class = ''; if (is_front_page() && !is_paged()) { $class = 'class="current_page_item"'; } $menu .= '
  • ' . $args['link_before'] . $text . $args['link_after'] . '
  • '; // If the front page is a page, add it to the exclude list if (get_option('show_on_front') == 'page') { if (!empty($list_args['exclude'])) { $list_args['exclude'] .= ','; } else { $list_args['exclude'] = ''; } $list_args['exclude'] .= get_option('page_on_front'); } } $list_args['echo'] = false; $list_args['depth'] = 1; $list_args['title_li'] = ''; $menu .= str_replace(array("\r", "\n", "\t"), '', wp_list_pages($list_args)); if ($menu) { $menu = ''; } $menu = '
    ' . $menu . "
    \n"; /** * Filter the HTML output of a page-based menu. * * @since 2.7.0 * * @see wp_page_menu() * * @param string $menu The HTML output. * @param array $args An array of arguments. */ $menu = apply_filters('wp_page_menu', $menu, $args); if ($args['echo']) { var_dump($menu); } else { return $menu; } return ''; } endif; /*---------------------------------------------------------------------- * Blog Favicon for custom favicon *----------------------------------------------------------------------*/ if (!function_exists('rox_blog_favicon')): /* * Function Name : rox_blog_favicon * Description : Add custom favicon for the theme * Function Hooked : wp_head * Function return Type : html * Function Since : 1.0.0 */ function rox_blog_favicon() { $favicon = rox_get_mod('logo_favicon'); if ($favicon !== ''): ?> ID)) { ?>

    get_sale_price(); $regular_price = $product->get_regular_price(); if (!empty($sale_price) && $regular_price > $sale_price) { $discount = (($regular_price - $sale_price) / $regular_price) * 100; $discount = round($discount, $precision); } } if ($discount > 0) { if ($return_html) { return apply_filters('rox_filter_rox_product_discount', '' . $discount . '%', $discount, $product->get_id()); } else return $discount; } return false; } } if( ! function_exists( 'rox_get_product_badge' ) ) { function rox_get_product_badge($product_id = NULL, $return_html = true, $check = array() ) { $product_id = !$product_id ? get_the_ID() : $product_id; $product = wc_get_product($product_id); $product_tags = array_map( function($tag_id) { $term = get_term_by( 'id', $tag_id, 'product_tag'); return $term->name; }, $product->get_tag_ids() ); if( ! $return_html ) return $product_tags; ob_start(); foreach( $product_tags as $tag_name ){ if( ! empty( $check ) && ! in_array( $tag_name, $check ) ) continue; printf( '%s', sanitize_title( $tag_name ), $tag_name ); } return apply_filters( 'rox_filter_rox_get_product_badge', ob_get_clean(), $product_id, $product ); } }