Skip to content

Instantly share code, notes, and snippets.

@mattbanks
Created March 21, 2013 14:24
Show Gist options
  • Select an option

  • Save mattbanks/5213396 to your computer and use it in GitHub Desktop.

Select an option

Save mattbanks/5213396 to your computer and use it in GitHub Desktop.
Run wp_install() as an output script in an Alfred 2 Workflow
<?php
$site = $_GET['q'];
$dir = "/Users/MYUSERNAME/Sites/$site";
$siteUrl = "http://sites.dev/$site";
$username = 'MYUSERNAME';
$email = 'MYEMAIL';
$password = 'MYPASSWORD';
define( 'WP_SITEURL', $siteUrl );
define( 'WP_INSTALLING', true );
require_once ( $dir . '/wp-load.php' );
require_once ( $dir . '/wp-admin/includes/upgrade.php' );
require_once ( $dir . '/wp-includes/wp-db.php' );
$result = wp_install( $site, $username, $email, true, null, $password );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment