Last active
September 12, 2019 05:05
-
-
Save Pseric/0e66741e1425bdcfc2ae20a4e775f4f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function crunchify_gravatar_alt( $crunchifyGravatar ) { | |
if ( have_comments() ) { | |
$alt = get_comment_author(); | |
} | |
else { | |
$alt = get_the_author_meta( 'display_name' ); | |
} | |
$crunchifyGravatar = str_replace( 'alt=\'\'', 'alt=\'Avatar for ' . $alt . '\' title=\'Gravatar for ' . $alt . '\'', $crunchifyGravatar ); | |
return $crunchifyGravatar; | |
} | |
add_filter( 'get_avatar', 'crunchify_gravatar_alt' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment