How to get current user’s phone number

<?php // number 9 will be user ID $all_meta_for_user = get_user_meta( 9 ); print_r( $all_meta_for_user ); // find the key that you want Array ( [first_name] => Array ( [0] => Tom ) [last_name] => Array ( [0] => Auger) [nickname] => Array ( [0] => tomauger ) How to get current user’s phone number … Read more

get current user not working

Have you tried to go with the “Safe usage” alternative given in the commented section? I honestly don’t have any experience with wp_get_current_user(), since I never use it, but anyhow, this ought to work: global $current_user; echo ‘Username: ‘ . $current_user->user_login . ‘<br />’; echo ‘User email: ‘ . $current_user->user_email . ‘<br />’; echo ‘User … Read more

How to get the user description with get_users?

The Native get_users() function returns an array of user objects and each on holds [ID] => 1 [user_login] => admin [user_pass] => $P$Bxudi6gJMk2GRt2ed3xvZ06c1BPZXi/ [user_nicename] => admin [user_email] => [email protected] [user_url] => http://localhost/ [user_registered] => 2010-06-29 07:08:55 [user_activation_key] => [user_status] => 0 [display_name] => Richard Branson as you can see user_description is not a part of … Read more

Create not-activated user in code, wordpress

WordPress does not have a active/deactivate function out of the box This worked for me to create users with aditional data. wp_insert_user(array( ‘user_login’ => $username, ‘user_pass’ => $password, ‘user_email’ => $email, ‘wp_user_level’ => $role, ‘show_admin_bar_front’ => ‘false’ //you probably won’t want normal users to see the admin bar )); http://codex.wordpress.org/Function_Reference/wp_insert_user Try adding a temporary role … Read more

How do I list in the backend all users that were assigned to a custom role?

User queries There is a WP_User_Query, analogous to WP_Query for posts: $wp_user_search = new WP_User_Query( array( ‘role’ => ‘editor’ ) ); $editors = $wp_user_search->get_results(); Usually this returns an array of row objects from the user table: echo ‘<ul>’; foreach ($editors as $editor): echo ‘<li>’.$edtior->display_name.'</li>’; endforeach; echo ‘</ul>’; However you can specify it to instead return … Read more

Locate authors on Google map version 3

If you’d like to show actual address as in street name/number you should use reverse geo coding api https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding basically its something like http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=false which you should probably on publish/save post (not on every page load). If you just like to show the markers on the map, I did something similar a couple of years … Read more