Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#30341 closed enhancement (fixed)

Additional hook for list table navigation area

Reported by: hlashbrooke's profile hlashbrooke Owned by: drewapicture's profile DrewAPicture
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: ui, administration Cc:

Description

The extra_tablenav() function in class-wp-posts-list-table.php provides a hook for adding extra filtering options (restrict_manage_posts), but there's no way to add extra markup (links, buttons, additional help text, etc.) after the 'Filter' button. I propose adding an additional hook to allow additional markup to be added here.

Adding a hook here may only have fringe use cases, but I don't see a reason not to include it as it won't affect any existing functionality and will make the post and page list tables just a little bit more extensible.

Attachments (2)

30341.diff (609 bytes) - added by hlashbrooke 10 years ago.
Adding hook with $which as the only argument
30341.2.diff (594 bytes) - added by wonderboymusic 9 years ago.

Download all attachments as: .zip

Change History (11)

@hlashbrooke
10 years ago

Adding hook with $which as the only argument

#1 @hlashbrooke
10 years ago

  • Keywords has-patch added

#2 @hlashbrooke
10 years ago

Patch includes hook named manage_posts_extra_tablenav with the $which variable as the only parameter. Happy to change the name of the hook if something else would be more in line with WP naming conventions.

#3 @boonebgorges
10 years ago

  • Version trunk deleted

#4 @SergeyBiryukov
10 years ago

  • Component changed from Administration to Posts, Post Types

#5 @cfoellmann
10 years ago

It would be great to generalize this action.
Maybe we could add a filter/action to the class WP_List_Table to allow manipulating/extending the extra_tablenav in all tables.

something like:"manage_{$this->screen->id}_extra_tablenav"

#6 @wonderboymusic
9 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to DrewAPicture
  • Status changed from new to reviewing

#7 @hlashbrooke
9 years ago

Always nice when an old patch suddenly gets opened up again :) Let me know if you need anything from my side, but @wonderboymusic's refresh looks like it covers everything.

#8 @DrewAPicture
9 years ago

  • Status changed from reviewing to accepted

#9 @DrewAPicture
9 years ago

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

In 35263:

Administration: Introduce the manage_posts_extra_tablenav action, which fires inside the tablenav for the posts list table, and just outside the "actions" container.

Props hlashbrooke, wonderboymusic.
Fixes #30341.

Note: See TracTickets for help on using tickets.