Title: Call to undefined function _wp_get_current_user()
Last modified: January 12, 2023

---

# Call to undefined function _wp_get_current_user()

 *  Resolved [wearedigiwolf](https://wordpress.org/support/users/wearedigiwolf/)
 * (@wearedigiwolf)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/call-to-undefined-function-_wp_get_current_user/)
 * Getting the below error currently – I have replaced the URL with mysite.com as
   it’s a business website. I came across a similar reference to it [here](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-_wp_get_current_use/)
   but there is no solution.
 * PHP Fatal error:  Uncaught Error: Call to undefined function _wp_get_current_user()
   in /var/www/mysite.com/html/wp-includes/pluggable.php:70\nStack trace:\n#0 /var/
   www/mysite.com/html/wp-includes/pluggable.php(1148): wp_get_current_user()\n#
   1 /var/www/mysite.com/html/wp-content/plugins/wp-optimize-premium/cache/file-
   based-page-cache-functions.php(36): is_user_logged_in()\n#2 [internal function]:
   wpo_cache()\n#3 {main}\n  thrown in /var/www/mysite.com/html/wp-includes/pluggable.
   php on line 70, referer: mysite.com

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/call-to-undefined-function-_wp_get_current_user/#post-16371839)
 * Can you try deactivating your other plugins and switching to a default theme 
   to check if the issues persists.
 * If it does not can you reactivate your themes/plugins one by one until you find
   the offending one?
 *  [wpdario](https://wordpress.org/support/users/wpdario/)
 * (@wpdario)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-_wp_get_current_user/#post-16416040)
 * Got following error on screen trying to wp-admin the site. I was able to admin
   the site some months ago without problems. Probable cause is some automatic wordpress
   update to 6.0.3. but I am not the site owner.
 * **Fatal error**: Uncaught Error: Call to undefined function wp_get_current_user()
   in /home/clients/bf6d4b9a256cfc32f6dd5832e4f280f3/dpge/wp-includes/capabilities.
   php:693 Stack trace: #0 /home/clients/bf6d4b9a256cfc32f6dd5832e4f280f3/dpge/wp-
   content/plugins/groups/lib/access/class-groups-post-access.php(232): current_user_can(‘
   groups_admin_gr…’) #1 /home/clients/bf6d4b9a256cfc32f6dd5832e4f280f3/dpge/wp-
   includes/class-wp-hook.php(307): Groups_Post_Access::posts_where(‘ AND dpge_posts…’,
   Object(WP_Query)) #2 /home/clients/bf6d4b9a256cfc32f6dd5832e4f280f3/dpge/wp-includes/
   plugin.php(235): WP_Hook->apply_filters(‘ AND dpge_posts…’, Array) #3 /home/clients/
   bf6d4b9a256cfc32f6dd5832e4f280f3/dpge/wp-includes/class-wp-query.php(2653): apply_filters_ref_array(‘
   posts_where’, Array) #4 /home/clients/bf6d4b9a256cfc32f6dd5832e4f280f3/dpge/wp-
   includes/class-wp-query.php(3613): WP_Query->get_posts() #5 /home/clients/bf6d4b9a256cfc32f6dd5832e4f280f3/
   dpge/wp-includes/post.php(2410): WP_Query->query(Array) #6 /home/clients/bf6d4b9a256cfc32
   in **/home/clients/bf6d4b9a256cfc32f6dd5832e4f280f3/dpge/wp-includes/capabilities.
   php** on line **693**
 * The error does prohibit to admin the site. Backend impossible. The function causing
   the error on line 393 is checking current user capability to admin the site using
   the **Groups plugin** function : current_user_can(‘groups_admin_gr…’) since renaming
   the plugin through ftp from outside enables to admin the site.
   Hereby the 2 source
   lines #692 and #693 involved from capabilites.php :function current_user_can(
   $capability, …$args ) {return user_can( wp_get_current_user(), $capability, …
   $args );
 * 
   I tried to update the plugin but it did not change, throwing same error. Please
   help. Why is the wp_get_current_user() undefined at the moment ?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Call to undefined function _wp_get_current_user()’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [wpdario](https://wordpress.org/support/users/wpdario/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-_wp_get_current_user/#post-16416040)
 * Status: resolved