[wp-trac] [WordPress Trac] #45747: Deprecate update_user_status

WordPress Trac noreply at wordpress.org
Wed Aug 21 03:09:01 UTC 2019


#45747: Deprecate update_user_status
---------------------------------------------+-----------------------------
 Reporter:  spacedmonkey                     |       Owner:  SergeyBiryukov
     Type:  enhancement                      |      Status:  reopened
 Priority:  normal                           |   Milestone:  5.3
Component:  Users                            |     Version:  3.0
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch good-first-bug commit  |     Focuses:  multisite
---------------------------------------------+-----------------------------
Changes (by azaozz):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 On one single test site after [45708] trying to update a user profile
 fails with "Sorry, marking a user as spam is only supported on Multisite."
 error. Seems to be coming from:
 {{{
     if ( isset( $userdata['spam'] ) && ! is_multisite() ) {
         return new WP_Error( 'no_spam', __( 'Sorry, marking a user as spam
 is only supported on Multisite.' ) );
     }
 }}}

 Seems the site was set to multisite at some point and the user table has
 `spam` and `deleted` fields with `'0'` as default values.

 Changing the above check to `! empty( $userdata['spam'] )` would fix it.
 Not sure how common that is, but probably better to fix?

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


More information about the wp-trac mailing list