Skip to:
Content

BuddyPress.org

Changeset 12600


Ignore:
Timestamp:
03/28/2020 09:20:53 PM (20 months ago)
Author:
boonebgorges
Message:

Members: Don't attempt to remove member type terms when they don't match.

Attempting to use WP's taxonomy functions to remove non-existent terms
can trigger errors in PHP 7.4+.

See #8264.

File:
1 edited

Legend:

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

    r12591 r12600  
    27232723    }
    27242724
     2725    // No need to continue if the member doesn't have the type.
     2726    $existing_types = bp_get_member_type( $user_id, false );
     2727    if ( ! in_array( $member_type, $existing_types, true ) ) {
     2728        return false;
     2729    }
     2730
    27252731    $deleted = bp_remove_object_terms( $user_id, $member_type, bp_get_member_type_tax_name() );
    27262732
Note: See TracChangeset for help on using the changeset viewer.