Languages: English • 日本語 (Add your language)
Returns boolean Whether a registered nav menu location has a menu assigned(true) or not(false).
<?php
if ( has_nav_menu( $location ) ) {
//Do something
} ?>
bool True if the registered location has a menu assigned, false otherwise.
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array( 'theme_location' => 'primary' ) );
} ?>
wp-includes/nav-menu.php
.