| | 2526 | /** |
| | 2527 | * Return a list of active components. |
| | 2528 | * |
| | 2529 | * @since 3.0.0 |
| | 2530 | * |
| | 2531 | * @return array Active components. |
| | 2532 | */ |
| | 2533 | function 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 | */ |
| | 2554 | function 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 | |