Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'mycred_ranking_row', 'mycredpro_rankings_row_avatar', 10, 4 );
- function mycredpro_rankings_row_avatar( $layout, $template, $user, $position ) {
- if ( isset( $user->ID ) )
- $user_id = $user->ID;
- elseif ( isset( $user['ID'] ) )
- $user_id = $user['ID'];
- else
- return $layout;
- $avatar = get_avatar( $user_id, 32 );
- $layout = str_replace( '%avatar%', $avatar, $layout );
- $progress = do_shortcode( '[mycred_rank_progress user_id="' . $user_id . '"]' );
- $layout = str_replace( '%progress%', $progress, $layout );
- return $layout;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement