Switch language

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




is_nav_menu [ WordPress Function ]

is_nav_menu ( $menu )
Parameters:
  • (int|string) $menu The menu to check (id, slug, or name)
Returns:
  • (bool) Whether the menu exists.
Defined at:



Check if the given ID is a navigation menu.

Returns true if it is; false otherwise.

Source


<?php
function is_nav_menu$menu ) {
    if ( ! 
$menu )
        return 
false;

    
$menu_obj wp_get_nav_menu_object$menu );

    if (
        
$menu_obj &&
        ! 
is_wp_error$menu_obj ) &&
        ! empty( 
$menu_obj->taxonomy ) &&
        
'nav_menu' == $menu_obj->taxonomy
    
)
        return 
true;

    return 
false;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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