nav_menu_meta_box_object filter-hookWP 3.0.0

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

wp_nav_menu_post_type_meta_boxes()
nav_menu_meta_box_object
wp_ajax_menu_get_metabox()
nav_menu_meta_box_object
wp_nav_menu_taxonomy_meta_boxes()
nav_menu_meta_box_object
wp-admin/includes/nav-menu.php 229
$post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
wp-admin/includes/ajax-actions.php 1835
$item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
wp-admin/includes/nav-menu.php 253
$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' );