Definition:
function insert_blog($domain, $path, $site_id) {}
Store basic site info in the blogs table.
This function creates a row in the wp_blogs table and returns the new blog’s ID. It is the first step in creating a new blog.
Parameters
- string $domain: The domain of the new site.
- string $path: The path of the new site.
- int $site_id: Unless you’re running a multi-network install, be sure to set this value to 1.
Return values
returns:The ID of the new row
Source code
function insert_blog($domain, $path, $site_id) {
global $wpdb;
$path = trailingslashit($path);
$site_id = (int) $site_id;
$result = $wpdb->insert( $wpdb->blogs, array('site_id' => $site_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time('mysql')) );
if ( ! $result )
return false;
refresh_blog_details($wpdb->insert_id);
return $wpdb->insert_id;
}
2019

February 12, 2011 


No comments yet... Be the first to leave a reply!