Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/02/2024 06:35:51 AM (4 months ago)
Author:
imath
Message:

Spamming users/Multisite: WP spam marker value is now the '1' string

See https://core.trac.wordpress.org/changeset/58261/

Fixes #9166
Closes https://github.com/buddypress/buddypress/pull/309

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-functions.php

    r13890 r13894  
    647647 * @since 5.0.0
    648648 *
    649  * @param int $user_id The user ID to spam or ham.
    650  * @param int $value   0 to mark the user as `ham`, 1 to mark as `spam`.
     649 * @param int    $user_id The user ID to spam or ham.
     650 * @param string $value   '0' to mark the user as `ham`, '1' to mark as `spam`.
    651651 * @return bool          True if the spam status of the member changed.
    652652 *                       False otherwise.
     
    665665    }
    666666
     667    if ( $value ) {
     668        $value = '1';
     669    }
     670
    667671    // Otherwise use the replacement function.
    668     $user = wp_update_user( array(
    669         'ID'   => $user_id,
    670         'spam' => $value,
    671     ) );
     672    $user = wp_update_user(
     673        array(
     674            'ID'   => $user_id,
     675            'spam' => $value,
     676        )
     677    );
    672678
    673679    if ( is_wp_error( $user ) ) {
Note: See TracChangeset for help on using the changeset viewer.