BP_REST_Components_Endpoint::activate_helper( string $component )

Activate component helper.

Description

Parameters

$component

(Required) Component id.

Return

(array)

Source

File: bp-core/classes/class-bp-rest-components-endpoint.php

393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
protected function activate_helper( $component ) {
 
    $active_components =& buddypress()->active_components;
 
    // Set for the rest of the page load.
    $active_components[ $component ] = 1;
 
    // Save in the db.
    bp_update_option( 'bp-active-components', $active_components );
 
    // Ensure that dbDelta() is defined.
    if ( ! function_exists( 'dbDelta' ) ) {
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    }
 
    // Run the setup, in case tables have to be created.
    require_once buddypress()->plugin_dir . 'bp-core/admin/bp-core-admin-schema.php';
 
    bp_core_install( $active_components );
    bp_core_add_page_mappings( $active_components );
 
    return $this->get_component_info( $component );
}

Changelog

Changelog
Version Description
0.1.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.