wp_get_nav_menu_object [ WordPress Function ]
wp_get_nav_menu_object ( $menu )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: wp_update_nav_menu_object, wp_get_nav_menus, wp_get_nav_menu_items, wp_get_nav_menu_to_edit, get_nav_menu_locations
Returns a navigation menu object.
Source
<?php
function wp_get_nav_menu_object( $menu ) {
if ( ! $menu )
return false;
$menu_obj = get_term( $menu, 'nav_menu' );
if ( ! $menu_obj )
$menu_obj = get_term_by( 'slug', $menu, 'nav_menu' );
if ( ! $menu_obj )
$menu_obj = get_term_by( 'name', $menu, 'nav_menu' );
if ( ! $menu_obj )
$menu_obj = false;
return $menu_obj;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/wp get nav menu items « WordPress Codex
... 'custom_menu_slug'; if ( ( $locations = get_nav_menu_locations() ) && isset( $ locations[ $menu_name ] ) ) { $menu = wp_get_nav_menu_object( $locations[ ...
codex.wordpress.org - #17821 (wp_get_nav_menu_object() doesn't check when passing to ...
wp_get_nav_menu_object() initially passes the menu string to get_term() to see if it's an ID. However, get_term() expects an integer or object and type-casts any ...
core.trac.wordpress.org - wp_get_nav_menu_object (WordPress Function) - WPSeek.com
WordPress lookup for wp_get_nav_menu_object, a WordPress Function. wpseek .com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Custom Menus and their Names
A quick look at the source code for the wp_nav_menu() function reveals the existence of the function wp_get_nav_menu_object(). If you read ...
www.wptavern.com