• 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.

    • This topic was modified 3 years, 6 months ago by bcworkz. Reason: code format partly fixed
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Using functions in wordpress pluggable.php file in my plugins’ is closed to new replies.