[wp-hackers] Bootstrapping WordPress
William P. Davis
will.davis at gmail.com
Tue Oct 4 16:24:37 UTC 2011
You can also just use wp-load.php. That will load up everything, although there's a variable (that I forget) that allows you to turn off plugins.
Sent from my BlackBerry® wireless device
-----Original Message-----
From: Dagan Henderson <Dagan.Henderson at epyllion.com>
Sender: wp-hackers-bounces at lists.automattic.com
Date: Tue, 4 Oct 2011 09:22:35
To: wp-hackers at lists.automattic.com<wp-hackers at lists.automattic.com>
Reply-To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Bootstrapping WordPress
Thanks, Brian!
-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Brian Layman
Sent: Tuesday, October 04, 2011 8:49 AM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Bootstrapping WordPress
On 10/4/2011 11:37 AM, Tom Barrett wrote:
> On 4 October 2011 16:19, Dagan Henderson<Dagan.Henderson at epyllion.com>wrote:
>> I'm working on a process that requires a cron job and would prefer to
>> execute the PHP script directly instead of using cURL to execute the
>> code via the Web server.
> I was shown this method (assuming PHP script is in the docroot):
>
> // Require the standard WordPress header
> require(dirname(__FILE__).'/wp-blog-header.php');
If you don't plan on doing something that visually themed like your site, you can just include wp-load.php.
I put a sample script for doing this sort of thing up on GitHub.
Here:
https://github.com/brianlayman/WordPress-Manipulator/blob/master/wpmanip.php
It demonstrates a bunch of techniques. It takes parameters from CLI or your browser. It loads the WP environment and access the WP API directly as well as demonstrates how to curl into the wp-admin area of a site to automate things.
Maybe you'll find it helpful.
--
Brian Layman
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list