Make WordPress Core

Opened 8 years ago

Last modified 5 years ago

#36860 closed enhancement

Introduce filter for users_have_content within delete action of users.php — at Initial Version

Reported by: garrett-eclipse's profile garrett-eclipse Owned by:
Milestone: 5.2 Priority: normal
Severity: normal Version: 4.6
Component: Users Keywords: has-patch needs-testing has-dev-note
Focuses: administration Cc:

Description

Hello,

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;

<?php
/**
  * 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 (0)

Note: See TracTickets for help on using tickets.