install_blog_defaults

Set blog defaults.

Description

install_blog_defaults( (int) $blog_id, (int) $user_id ); 

This function creates a row in the wp_blogs table.

Parameters (2)

0. $blog_id (int)
Ignored in this function.
1. $user_id (int)
The user id.

Usage

  1. if ( !function_exists( 'install_blog_defaults' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4. // Ignored in this function. 
  5. $blog_id = -1; 
  6.  
  7. // The user id. 
  8. $user_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = install_blog_defaults($blog_id, $user_id); 
  12.  

Defined (1)

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

/wp-includes/ms-functions.php  
  1. function install_blog_defaults($blog_id, $user_id) { 
  2. global $wpdb; 
  3.  
  4. require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 
  5.  
  6. $suppress = $wpdb->suppress_errors(); 
  7.  
  8. wp_install_defaults($user_id); 
  9.  
  10. $wpdb->suppress_errors( $suppress );