wp_nav_menu example

<?php get_template_part( 'template-parts/footer/footer-widgets' ); ?> <footer id="colophon" class="site-footer"> <?php if ( has_nav_menu( 'footer' ) ) : ?> <nav aria-label="<?php esc_attr_e( 'Secondary menu', 'twentytwentyone' ); ?>" class="footer-navigation"> <ul class="footer-navigation-wrapper"> <?php                     wp_nav_menu(
                        array(
                            'theme_location' => 'footer',
                            'items_wrap'     => '%3$s',
                            'container'      => false,
                            'depth'          => 1,
                            'link_before'    => '<span>',
                            'link_after'     => '</span>',
                            'fallback_cb'    => false,
                        )
                    );
                    ?>
$nav_menu_args_hmac = $nav_menu_args['args_hmac'];
        unset( $nav_menu_args['args_hmac'] );

        ksort( $nav_menu_args );
        if ( ! hash_equals( $this->hash_nav_menu_args( $nav_menu_args )$nav_menu_args_hmac ) ) {
            // Error: args_hmac_mismatch.             return false;
        }

        ob_start();
        wp_nav_menu( $nav_menu_args );
        $content = ob_get_clean();

        return $content;
    }
}
<?php esc_html_e( 'Menu', 'twentytwentyone' ); ?> <?php echo twenty_twenty_one_get_icon_svg( 'ui', 'menu' ); // phpcs:ignore WordPress.Security.EscapeOutput ?> </span> <span class="dropdown-icon close"><?php esc_html_e( 'Close', 'twentytwentyone' ); ?> <?php echo twenty_twenty_one_get_icon_svg( 'ui', 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput ?> </span> </button><!-- #primary-mobile-menu --> </div><!-- .menu-button-container --> <?php         wp_nav_menu(
            array(
                'theme_location'  => 'primary',
                'menu_class'      => 'menu-wrapper',
                'container_class' => 'primary-menu-container',
                'items_wrap'      => '<ul id="primary-menu-list" class="%2$s">%3$s</ul>',
                'fallback_cb'     => false,
            )
        );
        ?> </nav><!-- #site-navigation --> <?php

        wp_nav_menu( apply_filters( 'widget_nav_menu_args', $nav_menu_args$nav_menu$args$instance ) );

        echo $args['after_widget'];
    }

    /** * Handles updating settings for the current Navigation Menu widget instance. * * @since 3.0.0 * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Updated settings to save. */
Home | Imprint | This part of the site doesn't use cookies.