From e18b4c894b7c97bb3804ee8672903487e1ac1609 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 19 Oct 2017 13:04:28 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/nav-menu.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php index 9c4c6fb275..d1fa9507cd 100644 --- a/src/wp-admin/includes/nav-menu.php +++ b/src/wp-admin/includes/nav-menu.php @@ -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 ); ?>