I'm loading a PHP script in a wordpress page via curl call but when the script is run I get this in the log file,exactly after inserting or updating a new post : Call to undefined function is_user_logged_in() wordpress I tried searching for an answer but I couldn't find a working solution.
after searching i found this : The problem is that is_user_logged_in is a plug gable function, and is therefore loaded after this plugin logic is called. The solution is to make sure that you don't call this too early.
function your_login_function()
{
if ( is_user_logged_in() == true ) {
/* Some code */
} else {
/* Some other code */
}
}
add_action('init', 'your_login_function');
thanks for any help