Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load the Wordpress environment in a php script?

Tags:

ajax

wordpress

How can I load the Wordpress environment in a script, so I can use Wordpress' functions?

I need this because I need to call several functions from a script which is executed asynchronously.

like image 863
Hedge Avatar asked Mar 08 '11 16:03

Hedge


1 Answers

you need to load the wp-load.php file, which will then allow you to call wordpress functions.

For example:

require( '../wordpress/wp-load.php' );

with 'wordpress' being your install root.

like image 167
themerlinproject Avatar answered Oct 13 '22 07:10

themerlinproject