nav_menu_meta_box_object
Filters whether a menu items meta box will be added for the current object type.
If a falsey value is returned instead of an object, the menu items meta box for the current meta box object will not be added.
Usage
add_filter( 'nav_menu_meta_box_object', 'wp_kama_nav_menu_meta_box_object_filter' ); /** * Function for `nav_menu_meta_box_object` filter-hook. * * @param WP_Post_Type|false $post_type The current object to add a menu items meta box for. * * @return WP_Post_Type|false */ function wp_kama_nav_menu_meta_box_object_filter( $post_type ){ // filter... return $post_type; }
- $post_type(WP_Post_Type|false)
- The current object to add a menu items meta box for.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
nav_menu_meta_box_object
nav_menu_meta_box_object
nav_menu_meta_box_object
wp-admin/includes/nav-menu.php 260
$post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
wp-admin/includes/ajax-actions.php 1893
$item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
wp-admin/includes/nav-menu.php 293
$tax = apply_filters( 'nav_menu_meta_box_object', $tax );
Where the hook is used in WordPress
wp-admin/includes/admin-filters.php 53
add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' );