Skip to:
Content

BuddyPress.org

Changeset 12601


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

Groups: Don't attempt to remove group 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-groups/bp-groups-functions.php

    r12590 r12601  
    27582758    }
    27592759
     2760    // No need to continue if the group doesn't have the type.
     2761    $existing_types = bp_groups_get_group_type( $group_id, false );
     2762    if ( ! in_array( $group_type, $existing_types, true ) ) {
     2763        return false;
     2764    }
     2765
    27602766    $deleted = bp_remove_object_terms( $group_id, $group_type, 'bp_group_type' );
    27612767
Note: See TracChangeset for help on using the changeset viewer.