bp_new_site( int $blog_id, int $user_id, string $domain, string $path, int $site_id, array $meta )

When a new site is created in a multisite installation, run the activation routine on that site.


Description Description


Parameters Parameters

$blog_id

(Required) ID of the blog being installed to.

$user_id

(Required) ID of the user the install is for.

$domain

(Required) Domain to use with the install.

$path

(Required) Path to use with the install.

$site_id

(Required) ID of the site being installed to.

$meta

(Required) Metadata to use with the site creation.


Top ↑

Source Source

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

function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {

	// Bail if plugin is not network activated.
	if ( ! is_plugin_active_for_network( buddypress()->basename ) )
		return;

	// Switch to the new blog.
	switch_to_blog( $blog_id );

	/**
	 * Fires the activation routine for a new site created in a multisite installation.
	 *
	 * @since 1.7.0
	 *
	 * @param int    $blog_id ID of the blog being installed to.
	 * @param int    $user_id ID of the user the install is for.
	 * @param string $domain  Domain to use with the install.
	 * @param string $path    Path to use with the install.
	 * @param int    $site_id ID of the site being installed to.
	 * @param array  $meta    Metadata to use with the site creation.
	 */
	do_action( 'bp_new_site', $blog_id, $user_id, $domain, $path, $site_id, $meta );

	// Restore original blog.
	restore_current_blog();
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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