mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 03:56:07 +00:00
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. Built from https://develop.svn.wordpress.org/trunk@32833 git-svn-id: http://core.svn.wordpress.org/trunk@32804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8b6ff40038
commit
c9e1e2be9b
@ -728,6 +728,19 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
|
|||||||
$recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 15 ) );
|
$recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 15 ) );
|
||||||
$most_recent = $get_posts->query( $recent_args );
|
$most_recent = $get_posts->query( $recent_args );
|
||||||
$args['walker'] = $walker;
|
$args['walker'] = $walker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the posts displayed in the 'Most Recent' tab of the current
|
||||||
|
* post type's menu items meta box.
|
||||||
|
*
|
||||||
|
* @since 4.3.0
|
||||||
|
*
|
||||||
|
* @param array $most_recent An array of post objects being listed.
|
||||||
|
* @param array $args An array of WP_Query arguments.
|
||||||
|
* @param object $post_type The current post type object for this menu item meta box.
|
||||||
|
*/
|
||||||
|
$most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $post_type );
|
||||||
|
|
||||||
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>
|
</ul>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.3-alpha-32832';
|
$wp_version = '4.3-alpha-32833';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user