How to load the Wordpress environment in a php script?

前端 未结 1 909
抹茶落季
抹茶落季 2021-02-07 18:28

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 exe

相关标签:
1条回答
  • 2021-02-07 19:01

    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.

    0 讨论(0)
提交回复
热议问题