Fatal error: Call to undefined function wp_get_current_user()
-
I am developing a plugin, the code is like below,
if (!current_user_can('administrator')){ function hide_post_page_options() { //global $post; // Set the display css property to none for add category and add tag functions $hide_post_options = "<style type=\"text/css\"> .jaxtag { display: none; } #category-adder { display: none; } </style>"; print($hide_post_options); } add_action( 'admin_head', 'hide_post_page_options' ); }
But I get
Fatal error: Call to undefined function wp_get_current_user()
. I saw in a post that including pluggable.php in capabilities.php will and it did solve. But I don’t want to edit core files as it may cause concerns later on. Is there any way to do this without modifying core files?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Fatal error: Call to undefined function wp_get_current_user()’ is closed to new replies.