Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




unregister_nav_menu [ WordPress Function ]

unregister_nav_menu ( $location )
Parameters:
  • (array) $location the menu location identifier
Returns:
  • (bool) True on success, false on failure.
Defined at:



Unregisters a navigation menu for a theme.

Source


<?php
function unregister_nav_menu$location ) {
    global 
$_wp_registered_nav_menus;

    if ( 
is_array$_wp_registered_nav_menus ) && isset( $_wp_registered_nav_menus[$location] ) ) {
        unset( 
$_wp_registered_nav_menus[$location] );
        return 
true;
    }
    return 
false;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

1 User Note(s)

Gravatar
Here\'s how you might use this in your Child Theme to unregister parent theme menus:
<code>
add_action( \'init\', \'my_unregister_menus\' );

function my_unregister_menus() {
unregister_nav_menu(\'secondary\');
unregister_nav_menu(\'social\');
}
</code>

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics