Tag Archives: api

Set Badge To User

set_badge_to_user($user_id, $badge_url, $badge_title)

This function let’s you assign badges to your users.

Options:

OPTIONS DEFAULT ALTERNATIVES
user_id any user is should passed as parameter none
badge_url a valid URL for your badge file empty
badge_title any valid text for the title of your bage cannot be empty

Example:

			
global $xoouserultra;
			

$user_id = 11;	//use your custom user id.
$badge_url = 'http://usersultra.com/uultra-testing/wp-content/plugins/users-ultra-pro/addons/badges/badges/trophy.png';
$badge_title = 'Pro Member';			
$xoouserultra->api->set_badge_to_user($user_id, $badge_url, $badge_title);
			

Set User Meta Data

set_custom_meta_info($user_id, $meta, $value)

This function let’s you update the user’s meta data.

Options:

OPTIONS DEFAULT ALTERNATIVES
user_id any user is should passed as parameter none
meta any valid user’s meta field empty
value any information you would like to set empty

Example:

			
global $xoouserultra;
			
/
$user_id = 11;	//use your custom user id.
			
$xoouserultra->api->set_custom_meta_info($user_id, 'description', "My custom description for this user goes here.");
			

Get User’s Avatar

get_user_avatar($user_id, $options)

This function returns the user’s avatar.

Options:

OPTIONS DEFAULT ALTERNATIVES
size 40  any size in pixels
pic_type avatar avatar, mainpicture
size_type fixed fixed, dynamic

Example:

			
global $xoouserultra;
			
//get user avatar
$user_id = get_current_user_id();	
			
$args = array('size' => '40', 'pic_type' => 'avatar' ,  'size_type' => 'fixed');
$avatar = $xoouserultra->api->get_user_avatar($user_id, $args );
			
echo $avatar;