[wp-trac] [WordPress Trac] #31945: Deleting a user without reassigning should have clearer messaging about the implications

WordPress Trac noreply at wordpress.org
Mon Apr 13 14:56:58 UTC 2015


#31945: Deleting a user without reassigning should have clearer messaging about the
implications
-------------------------------------+---------------------------------
 Reporter:  jtsternberg              |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Media                    |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  ui, administration
-------------------------------------+---------------------------------

Comment (by Phyrax):

 Love the way you did the foreach loop, didn't even think of that
 @Tmeister.  The only problem is that the `count_user_posts()` method does
 not actually count attachments.  It uses `get_posts_by_author_sql()` for
 its WHERE statement.  In-turn, that method only checks if post_status is
 publish or private.

 Attachments are stored with the 'inherit' post_status, so the attachment
 post-type will always come up as zero.

 So, I took your code structure, re-factored it a bit, and put it into a
 callable method in includes/user.php

 As for the rest of this, I added multi-site compatibility to the method as
 well, so this works for both regular installs, and multi-site installs.

 Additionally, the `delete_user_form` action was passing the current
 WP_User object, not the actual list of users being deleted.  So, as to not
 break anything that is currently using that, I added a second parameter to
 the action, to actually pass the proper data.

 __Screenshot of both, regular and multi-site installs, using @Tmeister's
 HTML:__
 [[Image(http://imgur.com/BcgLcsa.png)]]

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


More information about the wp-trac mailing list