345 | | if ( is_multisite() ) |
346 | | $optional_components['blogs']['description'] = __( 'Make BuddyPress aware of new sites, new posts and new comments from across your entire network.', 'buddypress' ); |
| 345 | if ( is_multisite() ) |
| 346 | $optional_components['blogs']['description'] = __( 'Make BuddyPress aware of new sites, new posts and new comments from across your entire network.', 'buddypress' ); |
| 347 | |
| 348 | // If this is an upgrade from before BuddyPress 1.5, we'll have to convert deactivated |
| 349 | // components into activated ones |
| 350 | if ( empty( $active_components ) ) { |
| 351 | $deactivated_components = bp_get_option( 'bp-deactivated-components' ); |
| 352 | |
| 353 | // Trim off namespace and filename |
| 354 | $trimmed = array(); |
| 355 | foreach ( (array) $deactivated_components as $component => $value ) { |
| 356 | $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) ); |
| 357 | } |
| 358 | |
| 359 | // Loop through the optional components to create an active component array |
| 360 | foreach ( (array) $optional_components as $ocomponent => $ovalue ) { |
| 361 | if ( !in_array( $ocomponent, $trimmed ) ) { |
| 362 | $active_components[$ocomponent] = 1; |
| 363 | } |
| 364 | } |
| 365 | } |