update_user_status

Definition:
function update_user_status( $id, $pref, $value, $deprecated = null ) {}

Parameters

  • $id
  • $pref
  • $value
  • $deprecated

Defined actions

  • make_spam_user
    do_action( 'make_spam_user', $id );
  • make_ham_user
    do_action( 'make_ham_user', $id );

Source code

function update_user_status( $id, $pref, $value, $deprecated = null ) {

	global $wpdb;



	if ( null !== $deprecated  )

		_deprecated_argument( __FUNCTION__, '3.1' );



	$wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) );



	clean_user_cache( $id );



	if ( $pref == 'spam' ) {

		if ( $value == 1 )

			do_action( 'make_spam_user', $id );

		else

			do_action( 'make_ham_user', $id );

	}



	return $value;

}

3217

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: