Uncaught Error: Call to undefined function is_user_logged_in()
-
Can anyone tell me why this plugin is throwing the “undefined function” error?
It needs work to actually “do” something … obviously.
But I’ve stripped it back to basics to debug the error.<?php /** * Plugin Name: Utility Functions * Author: Me * Version: 1.0 * Author URI: https://www.mysite.com * Description: Adds role to body classes etc */ if ( is_user_logged_in() ) { add_filter('body_class','add_role_to_body'); add_filter('admin_body_class','add_role_to_body'); } function add_role_to_body($classes) { return $classes; } /* Add logged in user role as a body class for front or back end*/
- The topic ‘Uncaught Error: Call to undefined function is_user_logged_in()’ is closed to new replies.