[wp-trac] [WordPress Trac] #36860: Introduce filter for users_have_content within delete action of users.php

WordPress Trac noreply at wordpress.org
Wed Sep 26 20:07:55 UTC 2018


#36860: Introduce filter for users_have_content within delete action of users.php
-------------------------------------------------+-------------------------
 Reporter:  garrett-eclipse                      |       Owner:  garrett-
                                                 |  eclipse
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  4.9.9
Component:  Users                                |     Version:  4.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:
  tests                                          |  administration
-------------------------------------------------+-------------------------
Changes (by garrett-eclipse):

 * milestone:  Awaiting Review => 4.9.9


Old 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
> <?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

New 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 `$users_have_content` in the users.php
 https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-
 admin/users.php#L214

 Proposed filter;
 {{{#!php
 <?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

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/36860#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list