bp_core_install( array|bool $active_components = false )

Main installer.


Description Description

Can be passed an optional array of components to explicitly run installation routines on, typically the first time a component is activated in Settings.


Top ↑

Parameters Parameters

$active_components

(array|bool) (Optional) Components to install.

Default value: false


Source Source

File: bp-core/admin/bp-core-admin-schema.php

function bp_core_install( $active_components = false ) {

	bp_pre_schema_upgrade();

	// If no components passed, get all the active components from the main site.
	if ( empty( $active_components ) ) {

		/** This filter is documented in bp-core/admin/bp-core-admin-components.php */
		$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
	}

	// Install Activity Streams even when inactive (to store last_activity data).
	bp_core_install_activity_streams();

	// Install the signups table.
	bp_core_maybe_install_signups();

	// Install the invitations table.
	bp_core_install_invitations();

	// Install the nonmember opt-outs table.
	bp_core_install_nonmember_opt_outs();

	// Notifications.
	if ( !empty( $active_components['notifications'] ) ) {
		bp_core_install_notifications();
	}

	// Friend Connections.
	if ( !empty( $active_components['friends'] ) ) {
		bp_core_install_friends();
	}

	// Extensible Groups.
	if ( !empty( $active_components['groups'] ) ) {
		bp_core_install_groups();
	}

	// Private Messaging.
	if ( !empty( $active_components['messages'] ) ) {
		bp_core_install_private_messaging();
	}

	// Extended Profiles.
	if ( !empty( $active_components['xprofile'] ) ) {
		bp_core_install_extended_profiles();
	}

	// Blog tracking.
	if ( !empty( $active_components['blogs'] ) ) {
		bp_core_install_blog_tracking();
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.