#45747 closed enhancement (fixed)
Deprecate update_user_status
Reported by: | spacedmonkey | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Users | Keywords: | has-patch good-first-bug commit |
Focuses: | multisite | Cc: |
Description
Deprecate the function update_user_status
and replace with wp_update_user
.
Attachments (2)
Change History (13)
#2
follow-up:
↓ 3
@
5 years ago
@SergeyBiryukov This patch does keep those actions. It move them to wp-includes/user.php
#3
in reply to:
↑ 2
@
5 years ago
- Milestone changed from Awaiting Review to 5.2
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
Replying to spacedmonkey:
This patch does keep those actions. It move them to wp-includes/user.php
Ah, I missed that. Thanks!
#5
@
5 years ago
- Keywords commit added
I could not get 45747.diff to work: simply passing $userdata['spam']
to wp_update_user()
does not save the value in the database if it's not specifically handled in the function.
45747.2.diff fixes that, updates the docs, and also changes make_spam_user
and make_ham_user
to fire after the update, as they do in update_user_status()
, not before.
#8
follow-up:
↓ 9
@
5 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
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 then changed back to "single". 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?
Should we provide back compat for
make_spam_user
andmake_ham_user
actions?wp_maybe_update_network_user_counts()
is hooked to them.