"dependencies": {
"material-ui": "next",
"material-ui-icons": "latest",
"prop-types": "latest",
"react": "15.6.2",
"react-dom": "15.6.2",
"react-scripts": "latest",
"recompose": "latest",
"typeface-roboto": "latest"
},
如果我在一些插件中抛出上述文件,那么路径名是什么?
让我们说插件的名称是require_once(get_template_directory().'/inc/MCAPI.class.php');
答案 0 :(得分:3)
要求当前插件使用__DIR__
常量:
require_once(__DIR__ . '/inc/MCAPI.class.php');
要求来自其他插件或主题的文件使用WP_PLUGIN_DIR
常量:require_once(WP_PLUGIN_DIR . '/plugin_name/inc/MCAPI.class.php');