Make WordPress Core

Opened 2 years ago

Closed 18 months 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:


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 2 years ago.
Hook added via patch
class-wp-users-list-table.php.patch (995 bytes) - added by jakemgold 19 months ago.
19295.patch (907 bytes) - added by johnjamesjacoby 18 months ago.
Coding standards improvements

Download all attachments as: .zip

Change History (14)

jakemgold2 years ago

Hook added via patch

comment:1 jakemgold2 years ago

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

comment:2 jakemgold2 years ago

  • Keywords has-patch added

comment:3 nacin2 years ago

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

comment:4 Stephenh198822 months ago

  • Cc contact@… added

comment:5 Offereins19 months 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?

comment:6 jakemgold19 months 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.

comment:7 jakemgold19 months ago

  • Version set to trunk

comment:8 SergeyBiryukov19 months ago

  • Version changed from trunk to 3.3

Version number indicates when the enhancement was initially suggested.

comment:9 johnjamesjacoby18 months 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.

johnjamesjacoby18 months ago

Coding standards improvements

comment:10 jakemgold18 months ago

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

comment:11 nacin18 months 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.