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

Changing a username

You can look at the user_login column at the wp_users table. You can edit these values using any database tool (my favorite is PHPMyadmin http://www.phpmyadmin.net/home_page/index.php),

Users: List A to Z, for Users

There’s the WP_User_Query for that: /** * List all Users * Use as: Template Tag * * @uses WP_User_Query * @return (array) List of user objects */ wpse35713_get_users_list() { $query = new WP_User_Query( array( ‘order’ => ‘ASC’ ,’orderby’ => ‘login’ ) ); $users = $query->get_results(); $html = “<ul><li>”; foreach ( $users as $user ) { … Read more

How to delete all post and attachments of a user when I delete it?

The hook you choose is appropriate, and here is how to use it to delete all posts of all types (posts, pages, links, attachments, etc) of the deleted user: add_action(‘delete_user’, ‘my_delete_user’); function my_delete_user($user_id) { $args = array ( ‘numberposts’ => -1, ‘post_type’ => ‘any’, ‘author’ => $user_id ); // get all posts by this user: … Read more

Forcing WordPress to work differently

Yeah, the multiple user under one account is not stock with WordPress. You would essentially have to reprogram a lot of stuff to get everything you are wanting, and hacking the core is a no-no, as all updates would just over-write it. So you wouldn’t be able to update it, or have a lot of … Read more