如何加载字preSS环境PHP脚本?脚本、加载、环境、preSS

2023-09-10 17:20:11 作者:纵酒

我如何可以加载字preSS环境在脚本中,这样我就可以使用Word preSS'功能?

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.

推荐答案

您需要加载WP-load.php文件,该文件将允许您调用字preSS功能。

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

例如:

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

与'字preSS即为您安装根目录。

with 'wordpress' being your install root.