Emoji: When staticizing emoji into `<img>` tags, include an `alt` attribute of the original Emoji, to match both Smiley and Twemoji `<img>` tags.

git-svn-id: https://develop.svn.wordpress.org/trunk@31924 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2015-03-30 03:08:28 +00:00
parent c932690b40
commit 2fd1791bc1
1 changed files with 2 additions and 2 deletions

View File

@ -4275,7 +4275,7 @@ function wp_staticize_emoji( $text ) {
$chars = str_replace( array( '&#x', ';'), '', $flag );
list( $char1, $char2 ) = str_split( $chars, 5 );
$entity = '<img src="' . $cdn_url . $char1 . '-' . $char2 . $ext . '" class="wp-smiley" style="height: 1em; max-height: 1em;" />';
$entity = sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', $cdn_url . $char1 . '-' . $char2 . $ext, html_entity_decode( $flag ) );
$content = str_replace( $flag, $entity, $content );
}
@ -4290,7 +4290,7 @@ function wp_staticize_emoji( $text ) {
if ( ! empty( $matches[1] ) ) {
foreach ( $matches[1] as $emoji ) {
$char = str_replace( array( '&#x', ';'), '', $emoji );
$entity = '<img src="' . $cdn_url . $char . $ext . '" class="wp-smiley" style="height: 1em; max-height: 1em;" />';
$entity = sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', $cdn_url . $char . $ext, html_entity_decode( $emoji ) );
$content = str_replace( $emoji, $entity, $content );
}