Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // You can add the following function inside child theme functions.php or use Code Snippet plugin
- add_filter( 'get_avatar', 'wb_peepso_bbpress_get_avatar', 10, 6 );
- function wb_peepso_bbpress_get_avatar( $avatar, $id_or_email, $args_size, $args_default, $args_alt, $args ) {
- if( is_bbpress() ) {
- $peepSoUser = PeepSoUser::get_instance();
- $avatar_url = $peepSoUser->get_avatar();
- $avatar = sprintf(
- "<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>",
- esc_attr( $args['alt'] ),
- esc_url( $avatar_url ),
- esc_url( $avatar_url ) . ' 2x',
- esc_attr( join( ' ', $class = array( 'avatar avatar-14 photo' ) ) ),
- (int) $args['height'],
- (int) $args['width'],
- $args['extra_attr']
- );
- }
- return $avatar;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement