Make WordPress Core

Opened 7 years ago

Closed 4 months ago

#43318 closed enhancement (fixed)

New filter suggestion for manage_users-network_custom_column

Reported by: lenasterg's profile lenasterg Owned by: audrasjb's profile audrasjb
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch
Focuses: multisite Cc:

Description

Hi.
In a multisite installation, currently a custom column for the users list table uses the filter 'manage_users_custom_column' for both network users admin table and single subsite users admin table.
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php#L398

This is a bit confusing for plugin development since all the other filters and actions used in the network users admin table are based on the $screen->id, which for the network users admin page is "users-network".
For example the filters: "manage_users-network_columns" and "manage_users-network_sortable_columns"

The attached is a suggestion for introducing the filter 'manage_users-network_custom_column', without dropping the support for 'manage_users_custom_colunm.

Attachments (1)

class-wp-ms-users-list-table.php.patch (1.0 KB) - added by lenasterg 7 years ago.

Download all attachments as: .zip

Change History (13)

#1 @pento
6 years ago

  • Version trunk deleted

This ticket was mentioned in Slack in #core-multisite by lenasterg. View the logs.


6 months ago

#3 follow-up: @realloc
5 months ago

The suggestion looks good to me! What are your thoughts on taking it a step further by using apply_filters_deprecated for the first hook?

#4 in reply to: ↑ 3 @lenasterg
5 months ago

Replying to realloc:

The suggestion looks good to me! What are your thoughts on taking it a step further by using apply_filters_deprecated for the first hook?

Sounds nice, but which WordPress version should I use as $version in apply_filters_deprecated()?
I have no idea IF and in which WordPress version, the new filter suggestion would be accepted.

#5 follow-up: @realloc
5 months ago

I would set the current version. This information can be set later on, if needed.

#6 in reply to: ↑ 5 @lenasterg
5 months ago

Replying to realloc:

I would set the current version. This information can be set later on, if needed.

Perhaps the committer could handle this? I am unsure of the correct approach.

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


5 months ago

#8 @swissspidy
5 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 6.8

#10 follow-up: @audrasjb
4 months ago

@lenasterg I refreshed the proposed patch. What do you think?

#11 in reply to: ↑ 10 @lenasterg
4 months ago

Yes, I agree the changes make it more understandable, thank you for the update.

Replying to audrasjb:

@lenasterg I refreshed the proposed patch. What do you think?

#12 @audrasjb
4 months ago

  • Owner set to audrasjb
  • Resolution set to fixed
  • Status changed from new to closed

In 59878:

Comments: Remove bulk action dropdown depending on user caps.

This changeset introduces the manage_users-network_custom_column filter that fires for each custom column in the Network Users list table. This is an override hook for manage_users_custom_column which was already filtering each custom column in all Users list tables.

Props lenasterg, realloc, audrasjb.
Fixes #43318.

Note: See TracTickets for help on using tickets.