Changeset 34753 for trunk/src/wp-includes/ms-functions.php
- Timestamp:
- 10/01/2015 10:09:18 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r34676 r34753 295 295 296 296 return true; 297 }298 299 /**300 * Create an empty blog.301 *302 * @since MU 1.0303 *304 * @param string $domain The new blog's domain.305 * @param string $path The new blog's path.306 * @param string $weblog_title The new blog's title.307 * @param int $site_id Optional. Defaults to 1.308 * @return string|int The ID of the newly created blog309 */310 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {311 if ( empty($path) )312 $path = '/';313 314 // Check if the domain has been used already. We should return an error message.315 if ( domain_exists($domain, $path, $site_id) )316 return __( '<strong>ERROR</strong>: Site URL already taken.' );317 318 // Need to back up wpdb table names, and create a new wp_blogs entry for new blog.319 // Need to get blog_id from wp_blogs, and create new table names.320 // Must restore table names at the end of function.321 322 if ( ! $blog_id = insert_blog($domain, $path, $site_id) )323 return __( '<strong>ERROR</strong>: problem creating site entry.' );324 325 switch_to_blog($blog_id);326 install_blog($blog_id);327 restore_current_blog();328 329 return $blog_id;330 297 } 331 298
Note: See TracChangeset
for help on using the changeset viewer.