How to use functions found inside pluggable.php with my plugin files

Question

Am creating a plugin and needed to use get_user_by() and wp_check_password() and some cool functions available in the wordpress pluggable.php but it always throw an undefined function error.

But if i include the file directly in my plugin file like this

include (ABSPATH . 'wp_includes/pluggable.php')

I will be able to use those functions in my plugin but i read that is not good to include such files directly, so am seeking to know best way to do it without conflicts.
I have also tried creating a function like this

add_action('plugins_loaded', 'show');
function show() {
$user = get_user_by('ID, 1);
return $user;
}

Yet is not working.

0
Chris 3 months 0 Answers 20 views 0

Leave an answer