user profile replace first name last name with custom values
The solution was to move the update_options into the second function.
The solution was to move the update_options into the second function.
I’d have 2 menus, and show the 2nd only if the user meet criteria. Then, use CSS to show both menus like its only one. I think it’s the easiest way. And you have the benefit that the items aren’t really there, not just hidden.
Assuming that the author’s id is $author_id, the following code should work. You can of course use this to create your own function. <?php $url = get_the_author_meta(‘user_url’, $author_id); ?> <a href=”https://wordpress.stackexchange.com/questions/26599/<?php echo $url; ?>”><?php echo str_replace(‘http://’, ”, $url);?></a>
$args is a variable and as such should not be wrapped in quotes in the arguments array of query_posts(). Now that should be what’s causing the whole thing to fail. That being said, there are a few more flaws I see in your code: I’d recommend using the WP_Query class instead of query_posts() (why is … Read more
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
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
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
This loop looks pretty sure to me. You aren’t exposing any raw SQL anywhere, so injection attacks shouldn’t happen.
I agree with @Simon Blackbourn, but for arguments sake, here’s one technique: $data = get_user_meta( $user_id ); $data = wp_list_filter( $data, array( ‘ive-read-this’ ) ); $keys = array_keys( $data );
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