- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5
 
Open
Labels
Description
Pomander is a great place to write util scripts for interacting with Wordpress. It might even be a good idea to utilize some WP core functions in this plugin itself.
In doing so, we need a way to boot up the Wordpress core, something like this should work:
        define('BASE_PATH', dirname(__DIR__)."/wordpress/");
        define('WP_USE_THEMES', false);
        $_SERVER = array(
            "HTTP_HOST" => "http://localhost",
            "SERVER_NAME" => "http://localhost",
            "REQUEST_URI" => "/",
            "REQUEST_METHOD" => "GET",
            "SCRIPT_NAME" => "index.php",
            "PHP_SELF" => BASE_PATH
        );
        global $wp, $wp_query, $wp_the_query, $wp_rewrite, $wp_did_header;
        require(BASE_PATH . 'wp-load.php');