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

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

Update user meta array using foreach

Make sure to have identical keys in both of the arrays. Keys ‘first_name’, ‘last_name’ and respective keys ‘fname’, ‘lname’ are different. If you can make them identical then first do it, otherwise you will either need to do string manipulation for these keys before using them or put a condition like below in the foreach … Read more

E-mail Update – Validation

Well, you comparing the results of the email_exists function with $current_user->ID. If email exists, email_exists() return the ID of the user using that email or false if the email doesn’t exists. Imaging you are checking a email not being using, email_exists() return false and this if will validate: elseif(email_exists(esc_attr( $_POST[’email’] ) ) != $current_user->ID ) … Read more

Remove fields from WordPress profile

These are not default fields added by WordPress. They have to be added via a theme or plugin. You will need go and check where these fields are added. I would speculate that there are some kind of priority set when these fields are registered. You need to add a lower priority (higher number) to … Read more

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