How to load the Wordpress environment in a php script?

夙愿已清 提交于 2019-12-12 08:29:04

问题


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:


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.



来源:https://stackoverflow.com/questions/5235200/how-to-load-the-wordpress-environment-in-a-php-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!