Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( ! function_exists( 'kleo_menu_user_avatar' ) ) {
- /**
- * 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="' . esc_attr( bp_get_loggedin_user_avatar(array('width' => 200, 'height' => 200, '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 '';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment