Skip to content

Instantly share code, notes, and snippets.

@anveo
Created October 4, 2011 14:16
Show Gist options
  • Save anveo/1261745 to your computer and use it in GitHub Desktop.
Save anveo/1261745 to your computer and use it in GitHub Desktop.
#!/usr/bin/env php
<?php
//setup global $_SERVER variables to keep WP from trying to redirect
$_SERVER = array(
"HTTP_HOST" => "http://mysite.com",
"SERVER_NAME" => "http://mysite.com",
"REQUEST_URI" => "/",
"REQUEST_METHOD" => "GET"
);
//require the WP bootstrap
require_once(dirname(__FILE__).'/wp-load.php');
//add your own code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment