Skip to content

Instantly share code, notes, and snippets.

@HowardMei
Created October 30, 2012 14:51
Show Gist options
  • Select an option

  • Save HowardMei/3980661 to your computer and use it in GitHub Desktop.

Select an option

Save HowardMei/3980661 to your computer and use it in GitHub Desktop.
New Wordpress Install Profile
<?php
//$base_dir = '/home/username/www/wordpress';
//chdir($base_dir);
define( 'WP_SITEURL', 'http://localhost/wordpress' );
define( 'WP_INSTALLING', true );
require_once 'wp-load.php';
require_once 'wp-admin/includes/upgrade.php';
require_once 'wp-includes/wp-db.php';
/* Install Profile */
$title = 'Testando instalação por wp_install';
$username = 'admin';
$email = 'admin@localhost';
$password = '123456';
$blog_public = true;
wp_install( $title, $username, $email, $blog_public, null, $password );
/* Add Settings */
update_option( 'blogdescription', 'Nova descrição do blog :D' );
update_option( 'timezone_string', 'America/Sao_Paulo' );
update_option( 'admin_email', $email );
/* Redirect to login */
wp_redirect( wp_login_url() );
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment