is_user_logged_in() undefined at shutdown in plugin context
Edit 1 – Does not work // Catch is_user_logged_in() value before shutdown function is_user_logged_in_init() { $is_user_logged_in_init = is_user_logged_in() ?? false; } add_action(‘init’, ‘is_user_logged_in_init’); Leaving this here for my reference. Ref Edit 2 – Works I found two ways to solve this: Option 1 – Not recommended Ref include_once ABSPATH.’wp-includes/pluggable.php’; Option 2 – Rewrite the script, … Read more