Getting label name of extra user fields

Context: http://wordpress.org/extend/plugins/extra-user-fields/ Author URL: http://www.feweb.net/wordpressplugin_extrauserfields.htm Mentioned Functions: http://codex.wordpress.org/Function_Reference/the_author_meta http://codex.wordpress.org/Function_Reference/get_user_meta If you can already get the label BUT it comes with the input, and you are doing this in PHP, then do this: <?php # … # Your code which produces the input + label data into $data # … $document = new DOMDocument(); $document->loadHTML( $data … Read more

Checking if meta_value exists for any user

I personally try to stay away from mysql queries when I can use WordPress functions to achieve the same thing. You could try using get_users, Is this what you are trying to achieve: <?php $blogusers = get_users(‘meta_value=Referral’); foreach ($blogusers as $user) { echo $user->user_email; } ?> Untested. But that should display every user with a … Read more

Echo text if field under user_meta is empty with get_users()

When you have that much code to output concatenating it into one string like that makes it very difficult to read for others and yourself, also, to debug when things go wrong. Try this method for concatenating your output, $blogusers = get_users(‘role=contributor&orderby=display_name’); foreach ($blogusers as $user) { $name = $user->display_name; $url = get_author_posts_url($user->ID, $author_nicename); $class … Read more

Using and saving custom dropdown boxes on user profiles

You appear to be checking for variables that aren’t set. You set $selected $selected = get_the_author_meta( ‘user_top’, $user->ID ); But then you check for something called $topselected <select name=”user_top” id=”user_top”> <option value=”gotguns” <?php echo ($topselected == “gotguns”)? ‘selected=”selected”‘ : ” ?>>I got guns</option> The same thing happns with $middleselected and $bottomselected I think your problem … Read more

How do i get a specific user metadata using custom metavalue outside of wordpress?

If you have billing_phone as user meta, which is the preferred way, that query would be incorrect. The advantage of utilizing custom user meta and adding a field for billing_phone would allow you to use get_users(). $user = get_users(‘meta_key’ => ‘billing_phone’, ‘meta_value’ => $phone_number, ‘fields’ => ‘ID’); The above would give you an array of … Read more

update_user_meta updates to a wrong ID

That’s likely because you are using $current_user->ID, which always refers to the currently logged in user, or when “empty” object if not logged in (ID == 0). If you would like to update user meta on any other user you would have to supply the user ID of that user in the $_POST data as … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)