gmb_on_create_blog

Network Activated New Site Setup.

Description

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

When a new site is created when Maps Builder is network activated this function runs the appropriate install function to set up the site for the plugin.

Parameters (6)

0. $blog_id (int)
The Blog ID created
1. $user_id (int)
The User ID set as the admin
2. $domain (string)
The domain.
3. $path (string)
The path.
4. $site_id (int)
The site id.
5. $meta (array)
The meta.

Usage

  1. if ( !function_exists( 'gmb_on_create_blog' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'maps-builder/vendor/wordimpress/maps-builder-core/includes/install.php'; 
  3.  
  4. // The Blog ID created 
  5. $blog_id = -1; 
  6.  
  7. // The User ID set as the admin 
  8. $user_id = -1; 
  9.  
  10. // The domain. 
  11. $domain = ''; 
  12.  
  13. // The path. 
  14. $path = ''; 
  15.  
  16. // The site id. 
  17. $site_id = -1; 
  18.  
  19. // The meta. 
  20. $meta = array(); 
  21.  
  22. // NOTICE! Understand what this does before running. 
  23. $result = gmb_on_create_blog($blog_id, $user_id, $domain, $path, $site_id, $meta); 
  24.  

Defined (1)

The function is defined in the following location(s).

/vendor/wordimpress/maps-builder-core/includes/install.php  
  1. function gmb_on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { 
  2.  
  3. if ( is_plugin_active_for_network( GMB_PLUGIN_BASE ) ) { 
  4. switch_to_blog( $blog_id ); 
  5. restore_current_blog(); 
  6.