Skip to:
Content

BuddyPress.org

Changeset 9553


Ignore:
Timestamp:
02/24/2015 01:43:22 PM (10 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. (2.2 branch)

File:
1 edited

Legend:

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

    r9351 r9553  
    300300    }
    301301
    302     $current_components = buddypress()->active_components;
     302    $current_components       = buddypress()->active_components;
     303    $packaged_components      = array_flip( bp_core_get_packaged_component_ids() );
     304    $custom_active_components = array_diff_key( $current_components, $packaged_components );
    303305
    304306    switch ( $current_action ) {
     
    308310                if ( ! isset( $submitted[ $retired_component ] ) ) {
    309311                    unset( $current_components[ $retired_component ] );
     312
     313                    // Make sure custom components does not contain a retired component
     314                    if ( isset( $custom_active_components[ $retired_component ] ) ) {
     315                        unset( $custom_active_components[ $retired_component ] );
     316                    }
    310317                }
    311318            }
     
    323330    }
    324331
    325     return $components;
     332    // Active components is the list of packaged and custom components
     333    return array_merge( $components, $custom_active_components );
    326334}
    327335
Note: See TracChangeset for help on using the changeset viewer.