nav_menu_items_post filter-hookWP 3.2.0

Filters the posts displayed in the 'View All' tab of the current post type's menu items meta box.

This is one of the variants of the dynamic hook nav_menu_items_(post_type_name)

Usage

add_filter( 'nav_menu_items_post', 'wp_kama_nav_menu_items_post_filter', 10, 3 );

/**
 * Function for `nav_menu_items_post` filter-hook.
 * 
 * @param object[]     $posts     The posts for the current post type. Mostly `WP_Post` objects, but can also contain "fake" post objects to represent other menu items.
 * @param array        $args      An array of `WP_Query` arguments.
 * @param WP_Post_Type $post_type The current post type object for this menu item meta box.
 *
 * @return object[]
 */
function wp_kama_nav_menu_items_post_filter( $posts, $args, $post_type ){

	// filter...
	return $posts;
}
$posts(object[])
The posts for the current post type. Mostly WP_Post objects, but can also contain "fake" post objects to represent other menu items.
$args(array)
An array of WP_Query arguments.
$post_type(WP_Post_Type)
The current post type object for this menu item meta box.

Changelog

Since 3.2.0 Introduced.
Since 4.6.0 Converted the $post_type parameter to accept a WP_Post_Type object.

Where the hook is called

wp_nav_menu_item_post_type_meta_box()
nav_menu_items_post
wp-admin/includes/nav-menu.php 655
$posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type );

Where the hook is used in WordPress

Usage not found.