Why does this filter inside my functions.php not work on the get_avatar() function inside the comments?
// Remove height/width attributes on avatar img tags.
function myscript_remove_dimensions_avatars( $avatar ) {
$avatar = preg_replace( '/(width|height)=\"\d*\"\s/', "", $avatar );
return $avatar;
}
add_filter( 'get_avatar', 'myscript_remove_dimensions_avatars', 10 );
.
Inside my comments template I use this PHP tag to print the (gr)avatars.
<?php echo get_avatar( $comment, 96 ); ?>
Found the solution it's a little tiny difference but it works. :)
It's the double vs single quotes near the \d* section.