I added a function to force user to be logger on the site.
function force_login() {
if (is_user_logged_in()&& is_page() || is_user_logged_in() && is_single() ){
return;
}
else if(!is_user_logged_in()){
auth_redirect();
}else{
return;
}
}
Work fine except when i submit a specific form in cred, i get disconnected and redirected to the login page.
If i connect again the form will get submitted and the post get updated.
I try a couple of other method to check if the user is logged in but i get the same exact behavior as soon as i submit the form.
Hello. Thank you for contacting the Toolset support.
1)
As I understand CRED form should also displayed to loggedin users only?
2)
Could you please activate WP_DEBUG from wp-config.php file and check for any possible errors.
3)
Could you please try to resolve your issue by deactivating all third-party plugins as well as with the default theme to check for any possible conflicts with any of the plugins or themes?
1- Yes the whole site required the user to be logged
2- Debug is activated and show nothing
3- Problem is with the is_user_logged_in function. When the form is submitted and the page start reloading the function return an incorrect value. If I remove the call to that function everything work correctly