Exemplo n.º 1
0
 /**
  * Render user avatar menu item
  *
  * @param string $item_output
  * @param  array $item
  * @param  integer $depth
  * @param  object $args
  * @return string
  */
 function kleo_menu_user_avatar($item_output, $item, $depth, $args)
 {
     $output = '';
     if (is_user_logged_in()) {
         $url = bp_loggedin_user_domain();
         $attr_title = strip_tags($item->attr_title);
         $output .= '<a title="' . bp_get_loggedin_user_fullname() . '" class="kleo-bp-user-avatar' . ($args->has_children && in_array($depth, array(0, 1)) ? ' js-activated' : '') . '" href="' . $url . '" title="' . $attr_title . '">' . '<img src="' . bp_get_loggedin_user_avatar(array('width' => 25, 'height' => 25, 'html' => false)) . '" class="kleo-rounded" alt="">' . ($item->attr_title != '' ? ' ' . $item->attr_title : '');
         $output .= $args->has_children && in_array($depth, array(0, 1)) ? ' <span class="caret"></span></a>' : '</a>';
         return $output;
     } elseif ($args->has_children && in_array($depth, array(0, 1))) {
         return $item_output;
     } else {
         return '';
     }
 }
/**
 * Output the logged-in user's avatar.
 *
 * @see bp_get_loggedin_user_avatar() for a description of params.
 *
 * @param array|string $args Array of arguments for logged in user avatar.
 */
function bp_loggedin_user_avatar($args = '')
{
    echo bp_get_loggedin_user_avatar($args);
}