Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/24/2015 01:48:42 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Core: Allow custom components to continue to have directory pages.

Fixes regression introduced in 2.2. Props imath. See #6244. (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-admin-components.php

    r9544 r9555  
    308308    }
    309309
    310     $current_components = buddypress()->active_components;
     310    $current_components       = buddypress()->active_components;
     311    $packaged_components      = array_flip( bp_core_get_packaged_component_ids() );
     312    $custom_active_components = array_diff_key( $current_components, $packaged_components );
    311313
    312314    switch ( $current_action ) {
     
    316318                if ( ! isset( $submitted[ $retired_component ] ) ) {
    317319                    unset( $current_components[ $retired_component ] );
     320
     321                    // Make sure custom components does not contain a retired component
     322                    if ( isset( $custom_active_components[ $retired_component ] ) ) {
     323                        unset( $custom_active_components[ $retired_component ] );
     324                    }
    318325                }
    319326            }
     
    331338    }
    332339
    333     return $components;
     340    // Active components is the list of packaged and custom components
     341    return array_merge( $components, $custom_active_components );
    334342}
    335343
Note: See TracChangeset for help on using the changeset viewer.