WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#19295 closed enhancement (fixed)

extra_tablenav output for users should have a hook in it

Reported by: jakemgold Owned by: jakemgold
Milestone: 3.5 Priority: normal
Severity: trivial Version: 3.3
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

In the WP_Users_List_Table class, the extra_tablenav method should really have an action hook in it to allow developers to add additional filters / navigation choices here.

Think of it as the equivalent to the "restrict_manage_posts" action hook for posts.

Attachments (3)

extra_tablenav_users_hook.diff (477 bytes) - added by jakemgold 6 years ago.
Hook added via patch
class-wp-users-list-table.php.patch (995 bytes) - added by jakemgold 5 years ago.
19295.patch (907 bytes) - added by johnjamesjacoby 5 years ago.
Coding standards improvements

Download all attachments as: .zip

Change History (14)

@jakemgold
6 years ago

Hook added via patch

#1 @jakemgold
6 years ago

  • Owner set to jakemgold
  • Status changed from new to accepted

#2 @jakemgold
6 years ago

  • Keywords has-patch added

#3 @nacin
6 years ago

"extra_tablenav" is pretty internal. "restrict_manage_users" is consistent and simple.

#4 @Stephenh1988
6 years ago

  • Cc contact@… added

#5 @Offereins
5 years ago

For additional filtering we require also the possibility to filter the WP_User_Query object. It seems that only the "pre_user_query" filter is available to do just that. Sadly it's a bridge too far, because the exclude part of the query was already written out by then. Or am I misinformed?

#6 @jakemgold
5 years ago

  • Version 3.3 deleted

Modified name of hook per Nacin's recommendation, also modified the promote user capability check to only wrap the "change role" fields, so that additional filters can be injected here by hooks but not limited to that capability.

#7 @jakemgold
5 years ago

  • Version set to trunk

#8 @SergeyBiryukov
5 years ago

  • Version changed from trunk to 3.3

Version number indicates when the enhancement was initially suggested.

#9 @johnjamesjacoby
5 years ago

  • Milestone changed from Awaiting Review to 3.5

Moving to 3.5. This is an easy win, and blocking a bbPress 2.2 enhancement. Refreshing patch to match coding standards and prevent needless whitespace on output.

@johnjamesjacoby
5 years ago

Coding standards improvements

#10 @jakemgold
5 years ago

Thanks for the tweaks John. I didn't see any differences other than spacing... is that right?

#11 @nacin
5 years ago

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

In 22414:

restrict_manage_users action. props jakemgold, johnjamesjacoby. fixes #19295.

Note: See TracTickets for help on using tickets.