Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/10/2023 05:19:52 AM (12 months ago)
Author:
imath
Message:

List all active components in buddypress()->active_components

So far this global was only retrieving the list of built-in components that were activated from the BP Components settings screen of the WordPress Dashboard. Third party plugins/add-ons to be in this list needed to add their own component ID to it using this kind of code buddypress()->active_components['component_id'] = 1.

BuddyPress is now making sure any active components are listed into the buddypress()->active_components.

Fixes #8933
Closes https://github.com/buddypress/buddypress/pull/126

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-component.php

    r13511 r13513  
    254254                $this->search_query_arg = sanitize_title( $params['search_query_arg'] );
    255255            }
     256        }
     257
     258        // Make sure the `buddypress()->active_components` global lists all active components.
     259        if ( 'core' !== $this->id && ! isset( buddypress()->active_components[ $this->id ] ) ) {
     260            buddypress()->active_components[ $this->id ] = '1';
    256261        }
    257262
Note: See TracChangeset for help on using the changeset viewer.