Menus: Pass `$recent_args` parameter to `nav_menu_items_{$post_type_name}_recent` filter.

Props welcher, eclev91.
Fixes #39849.

git-svn-id: https://develop.svn.wordpress.org/trunk@41941 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-10-19 13:04:28 +00:00
parent 731d7643d2
commit e18b4c894b
1 changed files with 5 additions and 3 deletions

View File

@ -426,14 +426,16 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
* The dynamic portion of the hook name, `$post_type_name`, refers to the post type name.
*
* @since 4.3.0
* @since 4.9.0 Added the `$recent_args` parameter.
*
* @param array $most_recent An array of post objects being listed.
* @param array $args An array of WP_Query arguments.
* @param array $args An array of WP_Query arguments for the meta box.
* @param array $box Arguments passed to wp_nav_menu_item_post_type_meta_box().
* @param array $recent_args An array of WP_Query arguments for 'Most Recent' tab.
*/
$most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box );
$most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box, $recent_args );
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $most_recent ), 0, (object) $args );
?>
</ul>
</div><!-- /.tabs-panel -->