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

Built from https://develop.svn.wordpress.org/trunk@31924


git-svn-id: http://core.svn.wordpress.org/trunk@31903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2015-03-30 03:09:26 +00:00
parent 8ff664171d
commit 31db5d08fe
2 changed files with 3 additions and 3 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 );
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-beta3-31923';
$wp_version = '4.2-beta3-31924';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.