WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 7 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:

Description

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 7 months ago.
19514.2.diff (755 bytes) - added by MikeHansenMe 7 months ago.
missed a ;
19514.3.diff (1.3 KB) - added by MikeHansenMe 7 months ago.

Download all attachments as: .zip

Change History (10)

@wpsmith4 years ago

comment:1 @mordauk19 months ago

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

comment:2 @McGuive712 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.

comment:3 @DrewAPicture11 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.

@MikeHansenMe7 months ago

comment:4 @MikeHansenMe7 months ago

  • Keywords needs-refresh needs-docs removed

@MikeHansenMe7 months ago

missed a ;

comment:5 @DrewAPicture7 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

comment:6 @SergeyBiryukov7 months ago

wp_nav_menu_item_taxonomy_meta_box() should get a similar filter for consistency.

@MikeHansenMe7 months ago

Note: See TracTickets for help on using tickets.