How to load the Wordpress environment in a php scr

2019-04-25 15:50发布

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.

1条回答
Juvenile、少年°
2楼-- · 2019-04-25 16:23

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.

查看更多
登录 后发表回答