nav_menu_meta_box_object

nav_menu_meta_box_object

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.4.3

apply_filters('nav_menu_meta_box_object') is found 3 times:

  • /wp-admin/includes/ajax-actions.php line 1884
    	if ( ! empty( $_POST['item-object'] ) && isset( $items[ $_POST['item-object'] ] ) ) {
    		$menus_meta_box_object = $items[ $_POST['item-object'] ];
    
    		/** This filter is documented in wp-admin/includes/nav-menu.php */
    		$item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
    
    		$box_args = array(
    			'id'       => 'add-' . $item->name,
    			'title'    => $item->labels->name,
    			'callback' => $callback,
    			'args'     => $item,
    
  • /wp-admin/includes/nav-menu.php line 260
    		 *
    		 * @param WP_Post_Type|false $post_type The current object to add a menu items
    		 *                                      meta box for.
    		 */
    		$post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
    
    		if ( $post_type ) {
    			$id = $post_type->name;
    			// Give pages a higher priority.
    			$priority = ( 'page' === $post_type->name ? 'core' : 'default' );
    			add_meta_box(
    
  • /wp-admin/includes/nav-menu.php line 293
    	}
    
    	foreach ( $taxonomies as $tax ) {
    		/** This filter is documented in wp-admin/includes/nav-menu.php */
    		$tax = apply_filters( 'nav_menu_meta_box_object', $tax );
    
    		if ( $tax ) {
    			$id = $tax->name;
    			add_meta_box(
    				"add-{$id}",
    				$tax->labels->name,
    

See this hook used in plugins: