这是我的wp配置中的内容。php:
if ( !defined(\'ABSPATH\') )
define(\'ABSPATH\', dirname(__FILE__) . \'/\');
我正在从plugin/pluginName目录呼叫:
require_once( ABSPATH . \'wp-includes/user.php\');
但它正在回归:
Warning: require_once(ABSPATHwp-includes/user.php) [function.require-once]: failed to open stream: No such file or directory in /home/------/wp-content/plugins/---/---.php on line 43
Fatal error: require_once() [function.require]: Failed opening required \'ABSPATHwp-includes/user.php\' (include_path=\'.:/usr/lib/php:/usr/local/lib/php\') in /home/------/wp-content/plugins/---/---.php on line 43
知道我为什么会犯这个错误吗?有什么解决方案吗?谢谢
最合适的回答,由SO网友:onetrickpony 整理而成
如果您只需要包含该类,并且您的脚本位于插件目录中,如/wp-content/plugins/pluginName/script.php
, 然后您可以执行以下操作:
require realpath(\'../../../wp-includes/class-phpass.php\');