Title: [Plugin: Post From Site] Fatal error: undefined function
Last modified: August 19, 2016

---

# [Plugin: Post From Site] Fatal error: undefined function

 *  [eliwagar](https://wordpress.org/support/users/eliwagar/)
 * (@eliwagar)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-post-from-site-fatal-error-undefined-function/)
 * Hi, when activating the plugin I keep getting this error:
 * Fatal error: Call to undefined function wp_get_current_user() in /home1/meincont/
   public_html/wp-includes/capabilities.php on line 1059
 * I am running WP 3.1 with Mulltisites….
 * Can somebody provide a fix?

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

 *  [pascoa341](https://wordpress.org/support/users/pascoa341/)
 * (@pascoa341)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-post-from-site-fatal-error-undefined-function/#post-1609735)
 * Same Error here, only my fatal error is in capabilities.php on line 590. Does
   anyone know how to fix this?
 *  [chrisull](https://wordpress.org/support/users/chrisull/)
 * (@chrisull)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-post-from-site-fatal-error-undefined-function/#post-1609753)
 * Hi there,
 * In short, the plugin is trying to look and see what level the logged-in user 
   is. It’ll find that information in capabilities.php but it needs to use a function
   to do that (that function is **wp_get_current_user()**.
 * Plugin code fires in WordPress before this function is defined, so, your plugin
   breaks upon not knowing what **wp_get_current_user()** is.
 * A workaround is to define that function within the plugin. You can do this by
   including pluggable.php, the file where these kinds of functions are.
 * So insert this line near the top of your plugin:
 * `include_once(ABSPATH . 'wp-includes/pluggable.php');`
 *  [ZooFusion](https://wordpress.org/support/users/zoofusion/)
 * (@zoofusion)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-post-from-site-fatal-error-undefined-function/#post-1609794)
 * Hi Chrisull,
 * Thank you for posting this clear explanation and fix! After nearly pulling my
   hair out for an hour or two, I have finally stumbled across this workaround and
   am able to get my current project working again.
 * Many thanks!
 *  [Cristiano](https://wordpress.org/support/users/iclapton/)
 * (@iclapton)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-post-from-site-fatal-error-undefined-function/#post-1609797)
 * What do I need to do if I want to check the user Role instead of the user level?
 * Because I´m using custom roles and want to publish content in diferent post types,
   according to the role the user has…
 *  [chrisull](https://wordpress.org/support/users/chrisull/)
 * (@chrisull)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-post-from-site-fatal-error-undefined-function/#post-1609805)
 * Cristiano, I don’t think you can get the user role. A better way would probably
   be to check if the user can perform a certain task according to their role’s 
   capabilities.
 * Use `if current_user_can( 'capability_name' )` and use this list of capabilities:
 * [http://codex.wordpress.org/Roles_and_Capabilities](http://codex.wordpress.org/Roles_and_Capabilities)
 *  [jnorion](https://wordpress.org/support/users/jnorion/)
 * (@jnorion)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-post-from-site-fatal-error-undefined-function/#post-1609808)
 * I had this same problem, and the include posted above fixed it for me as well.
   I’m concerned about future updates breaking it, though. Can this be brought to
   the developer’s attention so it can be fixed in the future? Or is there something
   unusual about my installation (and those few above) that’s causing a problem 
   where there wouldn’t otherwise be one?

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

The topic ‘[Plugin: Post From Site] Fatal error: undefined function’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/post-from-site_e7e7e7.svg)
 * [Post From Site](https://wordpress.org/plugins/post-from-site/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-from-site/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-from-site/)
 * [Active Topics](https://wordpress.org/support/plugin/post-from-site/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-from-site/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-from-site/reviews/)

 * 6 replies
 * 6 participants
 * Last reply from: [jnorion](https://wordpress.org/support/users/jnorion/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-post-from-site-fatal-error-undefined-function/#post-1609808)
 * Status: not resolved