WordPress.org

Make WordPress Core

Changeset 32833


Ignore:
Timestamp:
06/18/2015 11:34:33 AM (4 years ago)
Author:
obenland
Message:

Make posts in the 'Most recent' tab of post type meta boxes filterable.

Provides parity with the 'View All' tab of post type meta boxes in Appearance > Menus.

Props jpyper, chriscct7.
Fixes #19365.

File:
1 edited

Legend:

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

    r32800 r32833  
    729729                $most_recent = $get_posts->query( $recent_args );
    730730                $args['walker'] = $walker;
     731
     732                /**
     733                 * Filter the posts displayed in the 'Most Recent' tab of the current
     734                 * post type's menu items meta box.
     735                 *
     736                 * @since 4.3.0
     737                 *
     738                 * @param array  $most_recent An array of post objects being listed.
     739                 * @param array  $args        An array of WP_Query arguments.
     740                 * @param object $post_type   The current post type object for this menu item meta box.
     741                 */
     742                $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $post_type );
     743
    731744                echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
    732745                ?>
Note: See TracChangeset for help on using the changeset viewer.