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 }

How would I hook into `clear_auth_cookie` to return the user’s ID that’s currently being logged out?

That action doesn’t pass that data: function return_user_data_on_logout( $user ) { Here, $user will alway be undefined. Additionally, you need to tell add_action how many parameters the function takes. But.. do_action( ‘clear_auth_cookie’ ); No information is passed to begin with, that’s not how this particular event/action works. So how do we get the current user … Read more

Hook to change Logout url

There’s no need to regenerate the logout URL (the $logout_url part in your code) because the first parameter passed to your function is already the logout URL. So basically, just rename that $force_reauth to $logout_url and remove the $logout_url = wp_nonce_url( … );: function my_custom_logout_url($logout_url, $redirect=null){ // rename the $force_reauth // And remove this: //$logout_url … Read more