get random users each time based on the meta key

As get_users does not support the order_by random, you could shuffle the array after calling the function. If you want to distribute it even, you could make another meta_value, where you store the number of appearances per user, and call the get_users with this new meta_key in ascending sort_order – this way the user with … Read more

Display user meta data from a textarea as a formated text

Have a look at both functions esc_attr() and esc_html() Replace this one : add_shortcode(‘USER_META’, ‘user_meta_shortcode_handler’); function user_meta_shortcode_handler($atts,$content=null){ return esc_html(get_user_meta($atts[‘user_id’], $atts[‘meta’], true)); } with this : add_shortcode(‘USER_META’, ‘user_meta_shortcode_handler’); function user_meta_shortcode_handler($atts,$content=null){ return esc_attr(get_user_meta($atts[‘user_id’], $atts[‘meta’], true)); }

How to save a label for an extra user meta field and to display it later?

you could also use a label parameter in your shortcode, like this: [user_meta user_id=”1″ label=”publications”] with these code changes: * Display the selected user meta data with a shortcode */ add_shortcode(‘user_meta’, ‘user_meta_shortcode_handler’); /* usage: [user_meta user_id=”1″ label=”publications”] */ function user_meta_shortcode_handler($atts,$content=null){ extract( shortcode_atts( array( ‘user_id’ => ‘1’, ‘label’ => ‘publications’ ), $atts ) ); $output.='<h3>’.$label.'</h3>’; $output.= … Read more

How to: get_user_meta – BuddyPress [closed]

Inside the loop, you can get the currently iterated user id using bp_get_member_user_id(). Also, it’s best practice to use bp_get_user_meta(), because it works better with certain kinds of BP plugins (multi-network, etc). Thus: if ( bp_has_members() ) { while ( bp_members() ) { bp_the_member(); $user_last = bp_get_user_meta( bp_get_member_user_id(), ‘last_name’, true ); } }

Display Country Flag in Profile WordPress/Buddypress

It sounds like you are trying to use those location values for something they were not intended for, so you need to convert the values somehow. You can rename your .gifs to match the location value then you could do… if( !empty($korea) ) { echo ‘<img src=”http://www.mydomain.com/flags/’.$korea.’.gif” border=0>’; } Please note the change I made … Read more

How to store array in usermeta in wordpress

Subtle difference in your name declaration, which needs to be name=”test[]”. <select name=”test[]” id=”test” multiple> <option value=”volvo”>Volvo</option> <option value=”saab”>Saab</option> <option value=”opel”>Opel</option> <option value=”audi”>Audi</option> </select> update_usermeta( $new_user, ‘test’, $_POST[‘test’] ); Edit re: your comment, $meta = get_user_meta($user_id, ‘test’); foreach ($meta as $key => $value) { echo $value; }

User Meta stuff

You have a few PHP issues preventing output- it appears your foreach is commented out with //. you do foreach( $our_children as $children ), but then you use $our_children instead of $children inside the foreach. $children->Age is for accessing an object’s property, but what you have here is an array, so it should be $children[‘Age’] … Read more

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