After logout browser’s back button into twenty sixteen theme profile

You should use the built in WordPress function is_user_logged_in(), as well as several other WordPress functions: if ( !is_user_logged_in() ) { wp_redirect( get_bloginfo( ‘url’ ) . ‘/index.php’ ); exit; } wp_redirect() handles the redirection for you. Please be aware that it does not exit automatically, so you should call it afterwards. I also built in … Read more

Update user meta on logout

For anyone who stumbles upon this, I have found a solution that works well for me. I wanted to be able to update user meta data during the logout process, whether it is user initiated or automatic through expiry of session data. So the solution: function logMeOutOrSomething($expiration, $user_id) { update_user_meta($user_id, ‘first_name’, ‘superMario’); return $expiration; } … Read more

do_action appearing outside of menu?

I think the reason is echo vs return: The function posts_logout_link from http://plugins.svn.wordpress.org/logout-password-protected-posts/trunk/logout.php is using echo. Your code is therefore both returning and echoing values. ps: You could consider using output buffering to fix this ob_start(); do_action(‘posts_logout_link’); $logout_link=ob_get_clean(); return $menu . ‘<li>’ . $logout_link . ‘</li>’; or modify the plugin code functions to your needs … Read more

What is difference between logout and switch off?

You have the plugin User Switching installed From their FAQ: What does “Switch off” mean? Switching off logs you out of your account but retains your user ID in an authentication cookie so you can switch straight back without having to log in again manually. It’s akin to switching to no user, and being able … Read more

Disconnect automattically after X minutes

By default, the “Remember Me” checkbox makes you get remembered for 14 days. This is filterable though. add below code in your theme functions.php where 31556926 = 1 year in seconds This code will change that value: add_filter( ‘auth_cookie_expiration’, ‘keep_me_logged_in_for_1_year’ ); function keep_me_logged_in_for_1_year( $expirein ) { return 31556926; // 1 year in seconds }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)