<?php
/**
 * @package shopbar
 */

defined( 'ABSPATH' ) || exit;


/**
* Footer
*/

if ( ! function_exists( 'shopbar_footer_copyrights' ) ) :
function shopbar_footer_copyrights() {
	?>
		<div class="footer-bottom">
            <p>
                <?php

                    $copyright_text = get_theme_mod( 'shopbar_footer_copyright_text' );
                    	if ( ! empty( $copyright_text ) ) :
                    		echo esc_html( $copyright_text );
                    else :
                        echo date_i18n(
                            /* translators: Copyright date format, see https://secure.php.net/date */
                            _x( 'Y', 'copyright date format', 'shopbar' )
                        );
                        ?>
                            <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
                        <?php
                    endif;
                ?>
            </p>
        </div>
	<?php
}
endif;
add_action( 'shopbar_action_footer', 'shopbar_footer_copyrights' );


/**
* Custom excerpt length.
*/
if ( ! function_exists( 'shopbar_my_excerpt_length' ) ) :
function shopbar_my_excerpt_length($length) {
	if ( is_admin() ) :
		return $length;
	endif;
  	return absint(get_theme_mod( 'shopbar_excerpt_length',70));
}
endif;
add_filter('excerpt_length', 'shopbar_my_excerpt_length');


/**
  * Get Breadcrumbs Content
  */
if( !function_exists( 'shopbar_get_breadcrumbs_content' ) ):
    function shopbar_get_breadcrumbs_content() {
        if(!is_front_page()) :

            // Build breadcrumb items
            $breadcrumb_items = array();

            if ( is_single() ) {
                // Single post breadcrumb
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );

                $blog_page_id = get_option('page_for_posts');
                if ( $blog_page_id ) {
                    $breadcrumb_items[] = array( 'label' => get_the_title( $blog_page_id ), 'url' => get_permalink( $blog_page_id ) );
                } else {
                    $breadcrumb_items[] = array( 'label' => __( 'Journal', 'shopbar' ), 'url' => home_url( '/' ) );
                }

                $categories = get_the_category();
                if ( !empty($categories) ) {
                    $category = $categories[0];
                    $breadcrumb_items[] = array( 'label' => $category->name, 'url' => get_category_link( $category->term_id ) );
                }

                $breadcrumb_items[] = array( 'label' => get_the_title(), 'url' => '' );

            } elseif ( is_category() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );

                $blog_page_id = get_option('page_for_posts');
                if ( $blog_page_id ) {
                    $breadcrumb_items[] = array( 'label' => get_the_title( $blog_page_id ), 'url' => get_permalink( $blog_page_id ) );
                }

                $breadcrumb_items[] = array( 'label' => single_cat_title( '', false ), 'url' => '' );

            } elseif ( is_home() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );

                $blog_page_id = get_option('page_for_posts');
                if ( $blog_page_id ) {
                    $breadcrumb_items[] = array( 'label' => get_the_title( $blog_page_id ), 'url' => '' );
                } else {
                    $breadcrumb_items[] = array( 'label' => __( 'Blog', 'shopbar' ), 'url' => '' );
                }

            } elseif ( is_page() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );

                // Check for parent pages
                $parent_id = wp_get_post_parent_id( get_the_ID() );
                if ( $parent_id ) {
                    $breadcrumb_items[] = array( 'label' => get_the_title( $parent_id ), 'url' => get_permalink( $parent_id ) );
                }

                $breadcrumb_items[] = array( 'label' => get_the_title(), 'url' => '' );

            } elseif ( is_shop() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );
                $breadcrumb_items[] = array( 'label' => __( 'Shop', 'shopbar' ), 'url' => '' );

            } elseif ( is_cart() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );
                $breadcrumb_items[] = array( 'label' => __( 'Cart', 'shopbar' ), 'url' => '' );

            } elseif ( is_checkout() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );
                $breadcrumb_items[] = array( 'label' => __( 'Cart', 'shopbar' ), 'url' => wc_get_cart_url() );
                $breadcrumb_items[] = array( 'label' => __( 'Checkout', 'shopbar' ), 'url' => '' );

            } elseif ( is_product_category() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );
                $breadcrumb_items[] = array( 'label' => __( 'Shop', 'shopbar' ), 'url' => get_permalink( wc_get_page_id( 'shop' ) ) );
                $breadcrumb_items[] = array( 'label' => single_term_title( '', false ), 'url' => '' );

            } elseif ( is_archive() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );
                $breadcrumb_items[] = array( 'label' => get_the_archive_title(), 'url' => '' );

            } elseif ( is_search() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );
                $breadcrumb_items[] = array( 'label' => __( 'Search Results', 'shopbar' ), 'url' => '' );

            } elseif ( is_404() ) {
                $breadcrumb_items[] = array( 'label' => __( 'Home', 'shopbar' ), 'url' => home_url( '/' ) );
                $breadcrumb_items[] = array( 'label' => __( '404 Not Found', 'shopbar' ), 'url' => '' );
            }

            // Only render breadcrumbs if we have items
            if ( empty( $breadcrumb_items ) ) :
                return;
            endif;

            ?>
            <!-- Breadcrumbs -->
            <div class="shop-breadcrumbs">
                <div class="container">
                    <nav class="shop-breadcrumb-nav" aria-label="<?php esc_attr_e( 'Breadcrumb', 'shopbar' ); ?>">
                        <?php foreach ( $breadcrumb_items as $i => $item ) : ?>
                            <?php if ( ! empty( $item['url'] ) ) : ?>
                                <a href="<?php echo esc_url( $item['url'] ); ?>"><?php echo esc_html( $item['label'] ); ?></a>
                                <span class="shop-breadcrumb-sep">/</span>
                            <?php else : ?>
                                <span class="shop-breadcrumb-current"><?php echo esc_html( $item['label'] ); ?></span>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </nav>
                </div>
            </div>
            <?php
        endif;
    }
endif;

/**
  * Get Page Title
  */

if( !function_exists( 'shopbar_get_title' ) ):
    function shopbar_get_title() {
        if(!is_front_page()) :
            // Skip title on cart page
            if(function_exists('is_cart') && is_cart()) :
                return;
            endif;
            // Skip title on checkout page
            if(function_exists('is_checkout') && is_checkout()) :
                return;
            endif;
            ?>
                <div class="page-title">
                    <?php shopbar_before_title_content(); ?>
                    <div class="container">
                        <h1 class="main-title"><?php the_title(); ?></h1>
                    </div>
                    <?php shopbar_after_title_content(); ?>
                </div>
            <?php
        endif;
    }
endif;


/**
  * Function for displaying menu item description
  *
  */
function shopbar_nav_description( $item_output, $item, $depth, $args ) {
    if( isset($args->theme_location) && !empty($item->description) ) :
        $description_html = '<span class="menu-bubble-description">'.esc_html($item->description).'</span>';
        return $item_output.$description_html;
    endif;
    return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'shopbar_nav_description', 10, 4 );


/**
  * Function for Minimizing dynamic CSS
  */
function shopbar_minimize_css($css){
    $css = preg_replace('/\/\*((?!\*\/).)*\*\//', '', $css);
    $css = preg_replace('/\s{2,}/', ' ', $css);
    $css = preg_replace('/\s*([:;{}])\s*/', '$1', $css);
    $css = preg_replace('/;}/', '}', $css);
    return $css;
}

/**
  * Adding blog sidebar classes to body
  */
if ( ! function_exists( 'shopbar_add_blog_sidebar_classes_to_body' ) ) :
function shopbar_add_blog_sidebar_classes_to_body($classes = '') {
    $sidebar_layout = get_theme_mod( 'shopbar_blog_single_sidebar_layout', 'no' );
    if ( 'right' === $sidebar_layout && is_single() ) :
        $classes[] = 'single-right-sidebar';

    elseif ( 'left' === $sidebar_layout && is_single() ) :
        $classes[] = 'single-left-sidebar';

    elseif ( 'no' === $sidebar_layout && is_single() ) :
        $classes[] = 'single-no-sidebar';
    endif;
    return $classes;
}
endif;
add_filter('body_class', 'shopbar_add_blog_sidebar_classes_to_body');


/**
 * Estimated Reading Time
 */
if (!function_exists('shopbar_estimated_reading_time')) {
    function shopbar_estimated_reading_time($content) {
        $word_count = str_word_count(strip_tags($content));
        $reading_time = ceil($word_count / 200); // Average reading speed: 200 words per minute
        return $reading_time;
    }
}

/**
 * Custom Comment Callback
 */
if (!function_exists('shopbar_comment_callback')) {
    function shopbar_comment_callback($comment, $args, $depth) {
        $commenter = wp_get_current_commenter();
        $req = get_option('require_name_email');
        ?>
        <div id="comment-<?php comment_ID(); ?>" <?php comment_class( 'comment-item' ); ?>>
            <div class="comment-item-header">
                <div class="comment-item-author">
                    <div class="comment-item-avatar">
                        <?php echo get_avatar($comment->comment_author_email, 40); ?>
                    </div>
                    <div class="comment-item-info">
                        <h4 class="comment-item-name"><?php echo wp_kses_post( get_comment_author_link() ); ?></h4>
                        <span class="comment-item-date"><?php printf(esc_html__('%s ago', 'shopbar'), human_time_diff(get_comment_time('U'), time())); ?></span>
                    </div>
                </div>
            </div>
            <div class="comment-item-text">
                <?php comment_text(); ?>
            </div>
            <div class="comment-item-actions">
                <?php
                comment_reply_link(array(
                    'depth'     => $depth,
                    'max_depth' => $args['max_depth'],
                    'before'    => '<button class="comment-action-btn">',
                    'after'     => '</button>',
                    'add_below' => 'comment',
                    'reply_text' => '<svg viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg> ' . esc_html__('Reply', 'shopbar'),
                ));
                ?>
            </div>
        <?php
    }
}

/**
 * Fallback menu
 */
if ( ! function_exists( 'shopbar_default_menu_fallback' ) ) :
function shopbar_default_menu_fallback( $args ) {
    $pages = get_pages( array(
        'sort_column'  => 'menu_order, post_title',
        'number'       => 5,
        'hierarchical' => false,
    ) );

    if ( empty( $pages ) ) {
        return;
    }

    foreach ( $pages as $page ) {
        printf(
            '<li class="menu-item"><a href="%s">%s</a></li>',
            esc_url( get_permalink( $page->ID ) ),
            esc_html( $page->post_title )
        );
    }
}
endif;

/**
 * Custom Comment Callback
 */

if ( ! function_exists( 'shopbar_related_blog_posts' ) ) :
function shopbar_related_blog_posts() {
    
    $related_args = array(
        'posts_per_page' => 2,
        'post__not_in'   => array( get_the_ID() ),
        'category__in'   => wp_get_post_categories( get_the_ID(), array( 'fields' => 'ids' ) ),
        'orderby'        => 'rand',
    );
    $related_query = new WP_Query( $related_args );
    if ( $related_query->have_posts() ) :
    ?>
    <!-- Related Posts -->
    <section class="related-section fade-in">
        <h2 class="related-title font-display"><?php esc_html_e( 'Continue reading', 'shopbar' ); ?></h2>
        <div class="related-grid">
            <?php
                while ( $related_query->have_posts() ) :
                    $related_query->the_post();
            ?>
            <a href="<?php the_permalink(); ?>" class="related-card">
                <?php if ( has_post_thumbnail() ) : ?>
                <?php the_post_thumbnail( 'medium' ); ?>
                <?php endif; ?>
                <div class="related-card-body">
                    <?php
                    $rel_categories = get_the_category();
                    if ( ! empty( $rel_categories ) ) :
                    ?>
                    <span class="related-card-category"><?php echo esc_html( $rel_categories[0]->name ); ?></span>
                    <?php endif; ?>
                    <h3 class="related-card-title"><?php the_title(); ?></h3>
                    <span class="related-card-date"><?php echo esc_html( get_the_date() ); ?></span>
                </div>
            </a>
            <?php endwhile; ?>
        </div>
    </section>
    <?php
        wp_reset_postdata();
    endif;
}
endif;

/**
 * Lucide-style outline SVG icon set.
 *
 * Returns inline, self-contained SVG markup
 *
 * @param string $name Icon key.
 * @param int    $size Pixel size of the square viewBox.
 * @return string SVG markup (empty string for unknown keys).
 */
if ( ! function_exists( 'shopbar_get_icon' ) ) :
function shopbar_get_icon( $name, $size = 18 ) {
	$shopbar_icons = array(
		'truck'        => '<path d="M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2"/><path d="M15 18H9"/><path d="M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14"/><circle cx="17" cy="18" r="2"/><circle cx="7" cy="18" r="2"/>',
		'rotate'       => '<path d="M3 2v6h6"/><path d="M3 13a9 9 0 1 0 3-7.7L3 8"/>',
		'lock'         => '<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>',
		'shield'       => '<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/>',
		'search'       => '<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',
		'user'         => '<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',
		'cart'         => '<circle cx="8" cy="21" r="1"/><circle cx="19" cy="21" r="1"/><path d="M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"/>',
		'bag'          => '<path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"/><path d="M3 6h18"/><path d="M16 10a4 4 0 0 1-8 0"/>',
		'menu'         => '<line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="18" y2="18"/>',
		'heart'        => '<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/>',
		'chevron-down' => '<path d="m6 9 6 6 6-6"/>',
		'chevron-right'=> '<path d="m9 18 6-6-6-6"/>',
		'chevron-left' => '<path d="m15 18-6-6 6-6"/>',
		'zap'          => '<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/>',
		'send'         => '<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/>',
		'credit-card'  => '<rect width="20" height="14" x="2" y="5" rx="2"/><line x1="2" x2="22" y1="10" y2="10"/>',
		'headphones'   => '<path d="M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3"/>',
		'arrow-right'  => '<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',
		'clock'        => '<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',
		'calendar'     => '<rect width="18" height="18" x="3" y="4" rx="2"/><line x1="3" x2="21" y1="10" y2="10"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="16" x2="16" y1="2" y2="6"/>',
		'quote'        => '<path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"/><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"/>',
		'mail'         => '<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',
		'facebook'     => '<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"/>',
		'instagram'    => '<rect width="20" height="20" x="2" y="2" rx="5" ry="5"/><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/><line x1="17.5" x2="17.51" y1="6.5" y2="6.5"/>',
		'youtube'      => '<path d="M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17"/><path d="m10 15 5-3-5-3z"/>',
		'twitter'      => '<path fill="currentColor" stroke="none" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>',
		'pinterest'    => '<path fill="currentColor" stroke="none" d="M12 2C6.48 2 2 6.48 2 12c0 4.08 2.45 7.59 5.95 9.13-.08-.78-.16-1.97.03-2.82.18-.78 1.16-4.94 1.16-4.94s-.3-.59-.3-1.47c0-1.38.8-2.41 1.79-2.41.85 0 1.26.64 1.26 1.4 0 .85-.54 2.13-.83 3.32-.24.99.5 1.8 1.48 1.8 1.77 0 3.13-1.87 3.13-4.57 0-2.39-1.72-4.06-4.17-4.06-2.84 0-4.5 2.13-4.5 4.33 0 .86.33 1.78.74 2.28.08.1.09.19.07.29l-.28 1.14c-.04.18-.15.22-.34.13-1.25-.58-2.03-2.4-2.03-3.86 0-3.15 2.29-6.04 6.6-6.04 3.46 0 6.16 2.47 6.16 5.77 0 3.44-2.17 6.21-5.18 6.21-1.01 0-1.96-.53-2.29-1.15l-.62 2.37c-.22.86-.83 1.95-1.24 2.61.94.29 1.93.45 2.96.45 5.52 0 10-4.48 10-10S17.52 2 12 2z"/>',
	);

	if ( ! isset( $shopbar_icons[ $name ] ) ) {
		return '';
	}

	return '<svg width="' . esc_attr( (string) $size ) . '" height="' . esc_attr( (string) $size ) . '" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">' . $shopbar_icons[ $name ] . '</svg>';
}
endif;

/**
 * Echo a Lucide-style SVG icon.
 *
 * @param string $name Icon key.
 * @param int    $size Pixel size.
 */
if ( ! function_exists( 'shopbar_icon' ) ) :
function shopbar_icon( $name, $size = 18 ) {
	echo shopbar_get_icon( $name, $size );
}
endif;

/**
 * Footer column menu fallback.
 *
 * Renders sensible default link columns that match the theme design when no
 * menu has been assigned to a footer menu location.
 *
 * @param array $args wp_nav_menu() arguments.
 */
if ( ! function_exists( 'shopbar_footer_menu_fallback' ) ) :
function shopbar_footer_menu_fallback( $args ) {
	$location = isset( $args['theme_location'] ) ? $args['theme_location'] : '';

	$shop_url = ( function_exists( 'wc_get_page_permalink' ) ) ? wc_get_page_permalink( 'shop' ) : home_url( '/' );

	$columns = array(
		'footer-shop' => array(
			array( 'label' => __( 'All Products', 'shopbar' ), 'url' => $shop_url ),
			array( 'label' => __( 'New Arrivals', 'shopbar' ), 'url' => $shop_url ),
			array( 'label' => __( 'Best Sellers', 'shopbar' ), 'url' => $shop_url ),
			array( 'label' => __( 'Deals &amp; Offers', 'shopbar' ), 'url' => $shop_url ),
			array( 'label' => __( 'Clearance Sale', 'shopbar' ), 'url' => $shop_url ),
		),
		'footer-service' => array(
			array( 'label' => __( 'Track Order', 'shopbar' ), 'url' => '#' ),
			array( 'label' => __( 'Returns &amp; Refunds', 'shopbar' ), 'url' => '#' ),
			array( 'label' => __( 'Shipping Policy', 'shopbar' ), 'url' => '#' ),
			array( 'label' => __( 'FAQ', 'shopbar' ), 'url' => '#' ),
			array( 'label' => __( 'Contact Us', 'shopbar' ), 'url' => '#' ),
		),
		'footer-about' => array(
			array( 'label' => __( 'Our Story', 'shopbar' ), 'url' => '#' ),
			array( 'label' => __( 'Careers', 'shopbar' ), 'url' => '#' ),
			array( 'label' => __( 'Blog', 'shopbar' ), 'url' => home_url( '/?post_type=post' ) ),
			array( 'label' => __( 'Press', 'shopbar' ), 'url' => '#' ),
			array( 'label' => __( 'Affiliate Program', 'shopbar' ), 'url' => '#' ),
		),
	);

	if ( ! isset( $columns[ $location ] ) ) {
		return;
	}

	foreach ( $columns[ $location ] as $item ) {
		printf(
			'<li class="menu-item"><a href="%s">%s</a></li>',
			esc_url( $item['url'] ),
			wp_kses_post( $item['label'] )
		);
	}
}
endif;