wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_get_nav_menu_object › WordPress Function
Seit3.0.0
Veraltetn/v
› wp_get_nav_menu_object ( $menu )
Parameter: |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Returns a navigation menu object.
Ähnliche Funktionen: wp_update_nav_menu_object, wp_get_nav_menu_name, wp_get_nav_menu_items, wp_get_nav_menus, wp_get_nav_menu_to_edit
Quellcode
function wp_get_nav_menu_object( $menu ) { $menu_obj = false; if ( is_object( $menu ) ) { $menu_obj = $menu; } if ( $menu && ! $menu_obj ) { $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 || is_wp_error( $menu_obj ) ) { $menu_obj = false; } /** * Filters the nav_menu term retrieved for wp_get_nav_menu_object(). * * @since 4.3.0 * * @param WP_Term|false $menu_obj Term from nav_menu taxonomy, or false if nothing had been found. * @param int|string|WP_Term $menu The menu ID, slug, name, or object passed to wp_get_nav_menu_object(). */ return apply_filters( 'wp_get_nav_menu_object', $menu_obj, $menu ); }