Make WordPress Core

Opened 4 years ago

Last modified 10 months ago

#19514 new enhancement

Add per-page filter for nav menu post type meta box

Reported by: wpsmith Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch
Focuses: Cc:


Currently, there is a default (50) for paginating Post Type Entries on the wp_nav_menu_item_post_type_meta_box(). While there are other ways to filter this, it would be great for larger sites or larger number of post objects to be able to increase this for UX reasons.

Attachments (4)

nav-menu-patch.patch (565 bytes) - added by wpsmith 4 years ago.
19514.diff (754 bytes) - added by MikeHansenMe 10 months ago.
19514.2.diff (755 bytes) - added by MikeHansenMe 10 months ago.
missed a ;
19514.3.diff (1.3 KB) - added by MikeHansenMe 10 months ago.

Download all attachments as: .zip

Change History (10)

#1 @mordauk
21 months ago

Seems reasonable to me, though I'd propose a filter named wp_nav_menu_per_page instead.

#2 @McGuive7
15 months ago

+1. Would love to see this as well. Another use case is wanting to also include private pages (and other post types) in the post type meta boxes. We have several clients who like to set pages to private while developing, which means these pages won't appear in the "Most Recent" or "View All" tabs in the post type metaboxes on the menus admin page. It would be great to be able to filter the $args passed to the $posts = $get_posts->query( $args ) call.

#3 @DrewAPicture
13 months ago

  • Component changed from General to Menus
  • Keywords needs-refresh needs-docs added

I agree that the filter should be renamed to something more obvious, maybe even something like wp_nav_menu_posts_per_page, or mimicking the list table *per_page hook, wp_nav_menu_{$post_type}_per_page.

At the very least, the patch will need a refresh and regeneration from the root directory. The filter will also need hook docs.

10 months ago

#4 @MikeHansenMe
10 months ago

  • Keywords needs-refresh needs-docs removed

10 months ago

missed a ;

#5 @DrewAPicture
10 months ago

  • Summary changed from Add Per Page Filter for Nav Menu Post Type Meta Box to Add per-page filter for nav menu post type meta box

#6 @SergeyBiryukov
10 months ago

wp_nav_menu_item_taxonomy_meta_box() should get a similar filter for consistency.

Note: See TracTickets for help on using tickets.