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

Limit amout of sessions on user-by-user basis?

One user account per person would definitely be easier, but I think you could kind of get this done by playing with the user sessions, which are stored as user_meta with the session_tokens key. Something along these lines maybe. add_action(‘template_redirect’, ‘check_max_num_sessions’); function check_max_num_sessions() { // Only check for logged in users if ( is_user_logged_in() ) … Read more

WordPress User Meta & ChromePHP or other way to debug/view php variables

In this code: if ($gender == ‘his_Male’) { $wpgender=”Male”; } elseif ($gender=”her_Female”) { $wpgender=”Female”; } else { $wpgender=”Other”; } You’re not comparing $gender to ‘her_Female’, you’re setting it to ‘her_Female’: } elseif ($gender=”her_Female”) { You should be using == or === (preferably ===, the difference is documented here). Your second question is really a chrome-php … Read more