[wp-hackers] Bootstrap WordPress
lists at rotorised.com
Thu Apr 12 23:34:16 UTC 2012
> Include the wp-load.php file.
This does come with problems if you're loading it inside a function, as
globals are set inside this without being explicitly declared as globals.
I find the following works:
global $wp_the_query, $wp_query, $wp_rewrite, $wp;
require_once(self::$wp_path . '/wp-load.php');
If you're running this on a mission critical site where you have to
reduce queries, I also recommend setting:
This ensures that you're never caught up with running cron tasks while
trying to access anything.
More information about the wp-hackers