Make WordPress Core

Opened 12 years ago

Closed 8 years ago

#19365 closed enhancement (fixed)

Pages listed under Most Recent and Search tabs of Page meta box in Appearance -> Menus should be filterable

Reported by: onokazu's profile onokazu Owned by: obenland's profile obenland
Milestone: 4.3 Priority: normal
Severity: normal Version: 3.2.1
Component: Menus Keywords: has-patch commit
Focuses: administration Cc:

Description

On the Appearance -> Menus administration page, pages listed under the Most Recent and Search tabs of the Page meta box on the left are not filterable. Since the pages listed under the View All tab of the said metabox are already filterable via the nav_menu_items_page hook, why not do the same for these 2 tabs?

I have a plugin that generates a number of pages that are accessible by registered users only, and I do not want administrators to be able to put these pages on the menu in any way.

Attachments (3)

19365.diff (598 bytes) - added by jpyper 11 years ago.
Add one line with an apply_filters for altering posts passed into the Most Recent tab, just like is already done for the View All tab.
19365.patch (660 bytes) - added by chriscct7 8 years ago.
Refresh with proper base and formatting
19365.2.patch (890 bytes) - added by chriscct7 8 years ago.
Adds doc

Download all attachments as: .zip

Change History (17)

#1 @jpyper
11 years ago

  • Cc jarrod@… added

I'm looking to do the same thing and wondered why those other two tabs were not filterable. It would be a simple addition, 2 extra lines.

Correction: It would not be just 2 extra lines. To filter out the "Most Recent" tab is just a matter of adding the filter, but for the search you need to get into the js doing the ajax search that spits out the results. Not so simple there, at least not for me.

I don't think this counts as a bug though, probably more fitting as an Enhancement. I wonder what we can do to get this any attention. Did you find a way around this seeing as you opened the ticket 15 months ago?

Last edited 11 years ago by jpyper (previous) (diff)

@jpyper
11 years ago

Add one line with an apply_filters for altering posts passed into the Most Recent tab, just like is already done for the View All tab.

#2 follow-up: @jpyper
11 years ago

  • Keywords has-patch added

patch added. This takes care of the Most Recent tab but doesn't do a thing about Search. This is "good enough" for my needs and I think would be a logical addition to core since the same filtering happens for View All.

#3 @SergeyBiryukov
11 years ago

  • Component changed from Administration to Menus
  • Type changed from defect (bug) to enhancement

#4 in reply to: ↑ 2 ; follow-up: @DrewAPicture
11 years ago

Replying to jpyper:

patch added. This takes care of the Most Recent tab but doesn't do a thing about Search. This is "good enough" for my needs and I think would be a logical addition to core since the same filtering happens for View All.

Please regenerate your patch from the WordPress install root.

Also, in staying consistent with coding standards and common variable hook naming-conventions, I suggest something more like this:

$most_recent = apply_filters( 'nav_menu_recent_{$post_type_name}_items', $most_recent );

#5 in reply to: ↑ 4 ; follow-up: @jpyper
11 years ago

Drew, I took your advice on the naming convention, but I don't know what you mean about regenerating from the WP install root. It took me embarrassingly long to figure out how to make the diff file in the first place...

#6 in reply to: ↑ 5 @DrewAPicture
11 years ago

Replying to jpyper:

Drew, I took your advice on the naming convention, but I don't know what you mean about regenerating from the WP install root. It took me embarrassingly long to figure out how to make the diff file in the first place...

If you look at 19365.diff, notice the path in bold at the top: /Users/jarrodpyper/Downloads/wordpress/wp-admin/includes/

You want to be generating the patch/diff from the /wordpress/ directory instead.

If you need further help, check out Submitting a patch in the handbook or visit the #wordpress-contribute IRC channel on Freenode and somebody can give you more help.

@chriscct7
8 years ago

Refresh with proper base and formatting

#7 @chriscct7
8 years ago

  • Focuses administration added
  • Milestone changed from Awaiting Review to 4.3
  • Owner set to chriscct7
  • Status changed from new to accepted

#8 @chriscct7
8 years ago

  • Keywords commit added

#9 @chriscct7
8 years ago

Thanks @onokazu, @drewapicture and @jpyper for your work on this ticket :-)

#10 @obenland
8 years ago

  • Keywords needs-docs added; commit removed

@chriscct7
8 years ago

Adds doc

#11 @chriscct7
8 years ago

  • Keywords commit added; needs-docs removed

This ticket was mentioned in Slack in #core by obenland. View the logs.


8 years ago

#13 @obenland
8 years ago

  • Owner changed from chriscct7 to obenland
  • Status changed from accepted to assigned

#14 @obenland
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 32833:

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.

Note: See TracTickets for help on using tickets.