Changeset 12767
- Timestamp:
- 10/24/2020 02:07:19 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-admin.php
r12738 r12767 1383 1383 1384 1384 // Get the old group type to check against. 1385 $group_type = bp_groups_get_group_type( $group_id ); 1386 1387 if ( 'remove_group_type' === $new_type ) { 1388 // Remove the current group type, if there's one to remove. 1389 if ( $group_type ) { 1390 $removed = bp_groups_remove_group_type( $group_id, $group_type ); 1391 if ( false === $removed || is_wp_error( $removed ) ) { 1392 $error = true; 1393 } 1385 $current_types = bp_groups_get_group_type( $group_id, false ); 1386 1387 if ( $current_types && 'remove_group_type' === $new_type ) { 1388 $group_types = array(); 1389 } elseif ( ! $current_types || 1 !== count( $current_types ) || $new_type !== $current_types[0] ) { 1390 $group_types = array( $new_type ); 1391 } 1392 1393 // Set the new group type. 1394 if ( isset( $group_types ) ) { 1395 $set = bp_groups_set_group_type( $group_id, $group_types ); 1396 if ( false === $set || is_wp_error( $set ) ) { 1397 $error = true; 1394 1398 } 1395 } else { 1396 // Set the new group type. 1397 if ( $new_type !== $group_type ) { 1398 $set = bp_groups_set_group_type( $group_id, $new_type ); 1399 if ( false === $set || is_wp_error( $set ) ) { 1400 $error = true; 1401 } 1402 } 1399 unset( $group_types ); 1403 1400 } 1404 1401 }
Note: See TracChangeset
for help on using the changeset viewer.