How to access the nav_menus panel with the customizer api?

The Nav Menus panel is added at customize_register action priority 11, so you need to set the priority at priority 12 (or above).

This works for me:

<?php
add_action( 'customize_register', function ( \WP_Customize_Manager $wp_customize ) {
    $panel = $wp_customize->get_panel( 'nav_menus' );
    if ( $panel ) {
        $panel->priority = 1;
    }
}, 12 );

Leave a Comment