Make WordPress Core


Ignore:
Timestamp:
10/19/2017 01:04:28 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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

Props welcher, eclev91.
Fixes #39849.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/nav-menu.php

    r41628 r41941  
    427427                 *
    428428                 * @since 4.3.0
     429                 * @since 4.9.0 Added the `$recent_args` parameter.
    429430                 *
    430431                 * @param array $most_recent An array of post objects being listed.
    431                  * @param array $args        An array of WP_Query arguments.
     432                 * @param array $args        An array of WP_Query arguments for the meta box.
    432433                 * @param array $box         Arguments passed to wp_nav_menu_item_post_type_meta_box().
     434                 * @param array $recent_args An array of WP_Query arguments for 'Most Recent' tab.
    433435                 */
    434                 $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box );
    435 
    436                 echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
     436                $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box, $recent_args );
     437
     438                echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $most_recent ), 0, (object) $args );
    437439                ?>
    438440            </ul>
Note: See TracChangeset for help on using the changeset viewer.