• Resolved kfuchs

    (@kfuchs)


    Note: WordPress installed locally on xampp.

    I am working on a plugin and when I try to use get_current_user_id()
    I get the error: Fatal error: Call to undefined function wp_get_current_user() in C:\xampp\htdocs\wordpress\wp-includes\user.php

    any ideas?

Viewing 1 replies (of 1 total)
  • Thread Starter kfuchs

    (@kfuchs)

    never mind, I added require_once(ABSPATH.’wp-includes/pluggable.php’); to the first line of my plugin and that worked.

    This seems like a bug with wordpress tho.

Viewing 1 replies (of 1 total)

The topic ‘trouble using get_current_user_id()’ is closed to new replies.