📜  包括文件夹 dir url wordpress - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:17.583000             🧑  作者: Mango

代码示例1
You sad you put the json in wp-includes, but in the url you wrote wp-content. 
So I give you the code for getting the server path for both folders:

// wp-includes
$file = ABSPATH . WPINC . '/json/users.json';

// wp-content
$file = WP_CONTENT_DIR . '/json/users.json';

You can find many WordPress constants (like ABSPATH, WPINCand WP_CONTENT_DIR on
http://wpengineer.com/2382/wordpress-constants-overview/