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

count the total number of comments the user has received for his published posts

You can use the get_comments() function like so: $total = get_comments( array( ‘post_author’ => get_current_user_id(), ‘post_status’ => ‘publish’, ‘type’ => ‘comment’, ‘count’ => true, ) ); echo ‘total comments of your all posts : ‘ . $total; Just customize the arguments based on your requirements/preferences, and in the above example, I’m retrieving the total number … Read more

In what part of the WordPress core does the users table and usermeta table get joined?

I’m not 100% what you are asking, it seems like several questions? But here goes: $meta_value = get_user_meta($user_id, $key, $single); For example: $first_name = get_user_meta($user_id, ‘first_name’, true); As for adding hooks I think this answer might be what you are looking for? How To Add Custom Form Fields To The User Profile Page? UPDATE Based … 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),

Create post for every user?

Create this as a plugin and activate it. It deactivates itself after it creates a primary page for Authors and sub-pages for each Author+ or better Role. At the end, it deactivates itself. Improve it as you wish. It uses // Hook activation to create new Author Pages register_activation_hook(__FILE__, function(){ // Create a Parent Page … Read more