2016-08-22 105 views
-1

我想在我自己的插件使用“username_exists”不工作,但是当我使用这个功能,我得到这个错误:“username_exists”功能在WordPress插件

Fatal error: Uncaught Error: Call to undefined function get_user_by() in E:\xampp\htdocs\wordpress\wp-includes\user.php:1271 Stack trace: #0 E:\xampp\htdocs\wordpress\wp-content\plugins\register-plus\index.php(86): username_exists('admin') #1 E:\xampp\htdocs\wordpress\wp-settings.php(255): include_once('E:\xampp\htdocs...') #2 E:\xampp\htdocs\wordpress\wp-config.php(89): require_once('E:\xampp\htdocs...') #3 E:\xampp\htdocs\wordpress\wp-load.php(37): require_once('E:\xampp\htdocs...') #4 E:\xampp\htdocs\wordpress\wp-blog-header.php(13): require_once('E:\xampp\htdocs...') #5 E:\xampp\htdocs\wordpress\index.php(17): require('E:\xampp\htdocs...') #6 {main} thrown in E:\xampp\htdocs\wordpress\wp-includes\user.php on line 1271

我怎样才能解决这个问题?

+0

这是功能是WP或定制? –

+0

这是我的一个WP函数(https://codex.wordpress.org/Function_Reference/username_exists) –

+0

好的。你会打电话给你的插件吗?我认为这个功能不包括你的插件 –

回答

1

我包括我的插件“pluggable.php”和问题修正

include_once(ABSPATH . 'wp-includes/pluggable.php');