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

WordPress Trac noreply at wordpress.org
Thu Mar 21 07:18:37 UTC 2019


#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:  5.2
Component:  Users                                |     Version:  4.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing 2nd-opinion  |     Focuses:
  dev-feedback                                   |  administration
-------------------------------------------------+-------------------------

Comment (by xkon):

 I find @birgire 's comment easier to read in general as the different
 naming of the filter makes more sense and it also avoids the 2 extra db
 checks so that can't be bad as well :) .

 Since I was checking this out [attachment:"36860.6.diff"] is based on that
 while adding the `users_have_additional_content` name for descriptive
 purposes. I'm pretty sure this will come in handy to more authors as well.

 And since I was at it a little "copy paste" to save some time as well:

 {{{

 add_filter(
         'users_have_additional_content',
         function( $flag, $userids ) {

                 if ( ! $flag ) {
                         error_log( print_r( $userids, true ) );

                         $flag = true;
                 }

                 return $flag;
         },
         15,
         2
 );
 }}}

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


More information about the wp-trac mailing list