create_empty_blog [ WordPress Function ]
create_empty_blog ( $domain, $path, $weblog_title, $site_id = 1 )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: wpmu_create_blog, restore_current_blog, wp_create_tag, remove_user_from_blog, maybe_create_table
Create an empty blog.
Source
<?php
function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
$domain = addslashes( $domain );
$weblog_title = addslashes( $weblog_title );
if ( empty($path) )
$path = '/';
// Check if the domain has been used already. We should return an error message.
if ( domain_exists($domain, $path, $site_id) )
return __( '<strong>ERROR</strong>: Site URL already taken.' );
// Need to back up wpdb table names, and create a new wp_blogs entry for new blog.
// Need to get blog_id from wp_blogs, and create new table names.
// Must restore table names at the end of function.
if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
return __( '<strong>ERROR</strong>: problem creating site entry.' );
switch_to_blog($blog_id);
install_blog($blog_id);
restore_current_blog();
return $blog_id;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- WPMU Functions/create empty blog « WordPress Codex
Description. Checks to see if the blog already exists, and if not it then inserts the blog into the database using insert_blog.
codex.wordpress.org - Function Reference/create empty blog « WordPress Codex
Description. Creates a new, empty blog. Parameters. $domain: (string) (required) Domain name for blog. Default: None. $path: (string) (required) Path to the blog ...
codex.wordpress.org - PHPXRef 0.7 : WordPress : Function Reference: create_empty_blog()
Function and Method Cross Reference. create_empty_blog(). Defined at: /wp- includes/ms-functions.php -> line 274. No references found.
phpxref.ftwr.co.uk - create_empty_blog | A HitchHackers guide through WordPress
Feb 11, 2011 ... function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { $ domain = addslashes( $domain ); $weblog_title = addslashes( ...
hitchhackerguide.com