Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#36860 new enhancement

Introduce filter for users_have_content within delete action of users.php

Reported by: garrett-eclipse Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.6
Component: Users Keywords:
Focuses: administration Cc:



I'd like to request an enhancement on the delete action for users. Idea - https://wordpress.org/ideas/topic/introduce-filter-for-users_have_content-within-delete-action-of-usersphp?replies=1#post-30346

The addition of a filter for line 220 of the users.php https://core.trac.wordpress.org/browser/trunk/src/wp-admin/users.php#L220

Proposed filter;

  * Filter the users_have_content, also known as the users have content flag, before use.
  * @since ###
  * @param boolean $users_have_content The flag for users have content.
$users_have_content = apply_filters( 'users_have_content', $users_have_content, $userids ) );

Allows for plugins to introduce reassign capabilities when their user relational data isn't handled through the posts_author or link_owner database checks. Example: Co Authors Plus saves additional author information in taxonomy terms. If a co-author is removed currently no reassignment can be made. With the filter the userids can be checked for coauthor relationships so as to enable the reassign user ability.

Thank you

Change History (1)

#1 @lukecavanagh
2 years ago

Seems like a useful fix for users who are using Co-Authors Plus plugin on a live site.

Note: See TracTickets for help on using tickets.