2016-08-22 149 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');