Skip to:
Content

BuddyPress.org

Ticket #7654: 7654-1.diff

File 7654-1.diff, 2.4 KB (added by espellcaste, 7 years ago)
  • src/bp-core/admin/bp-core-admin-components.php

    diff --git src/bp-core/admin/bp-core-admin-components.php src/bp-core/admin/bp-core-admin-components.php
    index 79f20d6db..7cbad26d1 100644
    function bp_core_admin_components_options() { 
    5151
    5252        // Declare local variables.
    5353        $deactivated_components = array();
    54 
    55         /**
    56          * Filters the array of available components.
    57          *
    58          * @since 1.5.0
    59          *
    60          * @param mixed $value Active components.
    61          */
    62         $active_components      = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
     54        $active_components = bp_core_get_active_components();
    6355
    6456        // The default components (if none are previously selected).
    6557        $default_components = array(
  • src/bp-core/bp-core-functions.php

    diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
    index 1441fb56f..13ac18cbd 100644
    function bp_core_get_components( $type = 'all' ) { 
    25232523        return apply_filters( 'bp_core_get_components', $components, $type );
    25242524}
    25252525
     2526/**
     2527 * Return a list of active components.
     2528 *
     2529 * @since 3.0.0
     2530 *
     2531 * @return array Active components.
     2532 */
     2533function bp_core_get_active_components() {
     2534
     2535        $active_components = bp_get_option( 'bp-active-components' );
     2536
     2537        /**
     2538         * Filters the list of active components.
     2539         *
     2540         * @since 3.0.0
     2541         *
     2542         * @param array $active_components Array of active component information.
     2543         */
     2544        return apply_filters( 'bp_active_components', $active_components );
     2545}
     2546
     2547/**
     2548 * Return a list of inactive components.
     2549 *
     2550 * @since 3.0.0
     2551 *
     2552 * @return array Inactive components.
     2553 */
     2554function bp_core_get_inactive_components() {
     2555
     2556        // Define variables.
     2557        $components          = bp_core_get_components( 'all' );
     2558        $active_components   = bp_core_get_active_components();
     2559        $inactive_components = array_diff( array_keys( $components ), array_keys( $active_components ) );
     2560
     2561        /**
     2562         * Filters the list of inactive components.
     2563         *
     2564         * @since 3.0.0
     2565         *
     2566         * @param array  $inactive_components Array of inactive components.
     2567         * @param array  $components          Array of all components.
     2568         * @param array  $active_components   Array of active components.
     2569         */
     2570        return apply_filters( 'bp_inactive_components', $inactive_components, $components, $active_components );
     2571}
     2572
    25262573/** Nav Menu ******************************************************************/
    25272574
    25282575/**