bp_active_components

  • apply_filters( 'bp_active_components', $active_components )

    Source Reference:

    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-loader.php :: Trac Source Line: 67
      		// Set the included and optional components.
      		$bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile' ) );
      
      		// Set the required components
      		$bp->required_components = apply_filters( 'bp_required_components', array( 'members' ) );
      
      		// Get a list of activated components
      		if ( $active_components = bp_get_option( 'bp-active-components' ) ) {
      			$bp->active_components      = apply_filters( 'bp_active_components', $active_components );
      			$bp->deactivated_components = apply_filters( 'bp_deactivated_components', array_values( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_keys( $bp->active_components ) ) ) );
      
      		// Pre 1.5 Backwards compatibility
      		} elseif ( $deactivated_components = bp_get_option( 'bp-deactivated-components' ) ) {
      			// Trim off namespace and filename
      			foreach ( (array) $deactivated_components as $component => $value )
      				$trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
      
      			// Set globals
      			$bp->deactivated_components = apply_filters( 'bp_deactivated_components', $trimmed );
      
  • apply_filters( 'bp_active_components', $bp->active_components )

    Source Reference:

    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-loader.php :: Trac Source Line: 86
      			$bp->deactivated_components = apply_filters( 'bp_deactivated_components', $trimmed );
      
      			// Setup the active components
      			$active_components     = array_flip( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ) );
      
      			// Loop through active components and set the values
      			$bp->active_components = array_map( '__return_true', $active_components );
      
      			// Set the active component global
      			$bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
      
      		// Default to all components active
      		} else {
      			// Set globals
      			$bp->deactivated_components = array();
      
      			// Setup the active components
      			$active_components     = array_flip( array_values( array_merge( $bp->optional_components, $bp->required_components ) ) );
      
      			// Loop through active components and set the values
      
    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-loader.php :: Trac Source Line: 100
      			$bp->deactivated_components = array();
      
      			// Setup the active components
      			$active_components     = array_flip( array_values( array_merge( $bp->optional_components, $bp->required_components ) ) );
      
      			// Loop through active components and set the values
      			$bp->active_components = array_map( '__return_true', $active_components );
      
      			// Set the active component global
      			$bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
      		}
      
      		// Loop through optional components
      		foreach( $bp->optional_components as $component )
      			if ( bp_is_active( $component ) && file_exists( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) )
      				include( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' );
      
      		// Loop through required components
      		foreach( $bp->required_components as $component )
      			if ( file_exists( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) )
      
  • apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) )

    Source Reference:

    • Component: BuddyPress :: bp-core
      File: /bp-core/admin/bp-core-admin.php :: Trac Source Line: 337
       * @since 1.5
       */
      function bp_core_admin_component_options() {
      	global $bp_wizard;
      
      	// Load core functions, if needed
      	if ( !function_exists( 'bp_get_option' ) )
      		require( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
      
      	$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
      
      	// An array of strings looped over to create component setup markup
      	$optional_components = array(
      		'xprofile' => array(
      			'title'       => __( 'Extended Profiles', 'buddypress' ),
      			'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' )
      		),
      		'settings' => array(
      			'title'       => __( 'Account Settings', 'buddypress' ),
      			'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' )
      
    • Component: BuddyPress :: bp-core
      File: /bp-core/admin/bp-core-update.php :: Trac Source Line: 385
      				$existing_pages[$index] = '';
      		}
      
      		if ( !empty( $existing_pages['blogs'] ) )
      			$existing_blog_page = '&selected=' . $existing_pages['blogs'];
      		else
      			$existing_blog_page = '';
      
      		// Get active components
      		$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
      
      		// Check for defined slugs
      		$members_slug    = !empty( $bp->members->slug    ) ? $bp->members->slug    : __( 'members',  'buddypress' );
      
      		// Groups
      		$groups_slug     = !empty( $bp->groups->slug     ) ? $bp->groups->slug     : __( 'groups',   'buddypress' );
      
      		// Activity
      		$activity_slug   = !empty( $bp->activity->slug   ) ? $bp->activity->slug   : __( 'activity', 'buddypress' );
      
    • Component: BuddyPress :: bp-core
      File: /bp-core/admin/bp-core-update.php :: Trac Source Line: 1085
      	$bp_wizard = new BP_Core_Setup_Wizard;
      }
      add_action( bp_core_update_admin_hook(), 'bp_core_setup_wizard_init', 7 );
      
      function bp_core_install( $active_components = false ) {
      	global $wpdb;
      
      	if ( empty( $active_components ) )
      		$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
      
      	require( dirname( __FILE__ ) . '/bp-core-schema.php' );
      
      	// Core DB Tables
      	bp_core_install_notifications();
      
      	// Activity Streams
      	if ( !empty( $active_components['activity'] ) )
      		bp_core_install_activity_streams();
      

Comments are closed.