wp_install [ WordPress Function ]
wp_install ( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Installs the blog
{@internal Missing Long Description}}
Source
<?php
function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.6' );
wp_check_mysql_version();
wp_cache_flush();
make_db_current_silent();
populate_options();
populate_roles();
update_option('blogname', $blog_title);
update_option('admin_email', $user_email);
update_option('blog_public', $public);
$guessurl = wp_guess_url();
update_option('siteurl', $guessurl);
// If not a public blog, don't ping.
if ( ! $public )
update_option('default_pingback_flag', 0);
// Create default user. If the user already exists, the user tables are
// being shared among blogs. Just set the role in that case.
$user_id = username_exists($user_name);
$user_password = trim($user_password);
$email_password = false;
if ( !$user_id && empty($user_password) ) {
$user_password = wp_generate_password( 12, false );
$message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
$user_id = wp_create_user($user_name, $user_password, $user_email);
update_user_option($user_id, 'default_password_nag', true, true);
$email_password = true;
} else if ( !$user_id ) {
// Password has been provided
$message = '<em>'.__('Your chosen password.').'</em>';
$user_id = wp_create_user($user_name, $user_password, $user_email);
} else {
$message = __('User already exists. Password inherited.');
}
$user = new WP_User($user_id);
$user->set_role('administrator');
wp_install_defaults($user_id);
flush_rewrite_rules();
wp_new_blog_notification($blog_title, $guessurl, $user_id, ($email_password ? $user_password : __('The password you chose during the install.') ) );
wp_cache_flush();
return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Automating WordPress customizations – the install.php way ...
Aug 10, 2007 ... Notice that function_exists('wp_install') check? Why is it there? Doesn't WordPress know which functions it has and which it doesn't? This is the ...
wpbits.wordpress.com - Installing WordPress « WordPress Codex
WordPress is well known for its ease of installation. Under most circumstances installing WordPress is a very simple process and takes less than five minutes to ...
codex.wordpress.org - php - Manual wp_install() difficulties - Stack Overflow
How do I use the require_once inside of a function while still being able to access and manage the globals? That idea is wrong in general. You can ...
stackoverflow.com - PHPXRef 0.7 : WordPress : Function Reference: wp_install()
Function and Method Cross Reference. wp_install(). Defined at: /wp-admin/ includes/upgrade.php -> line 22. Referenced 1 times: /wp-admin/install.php -> line ...
phpxref.ftwr.co.uk
Kullanýcý Tartýþmalarý [ wordpress.org ]
- Tim S on "Installation service code errors"
- ax-lev on "Installation service code errors"
- Tim S on "Installation service code errors"
- ax-lev on "Installation service code errors"
- Tim S on "Installation service code errors"
- ax-lev on "Installation service code errors"
- moshu on "wordpress install with phpmyadmin"
- tipupp on "wordpress install with phpmyadmin"