Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP-r45134: Emoji: Update Twemoji to version 12.0.0. #416

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/wp-includes/formatting.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -2903,7 +2903,7 @@ function wp_resource_hints() {
* The path is removed in the foreach loop below.
*/
/** This filter is documented in wp-includes/formatting.php */
$hints['dns-prefetch'][] = apply_filters( 'emoji_svg_url', 'https://twemoji.classicpress.net/11/svg/' );
$hints['dns-prefetch'][] = apply_filters( 'emoji_svg_url', 'https://twemoji.classicpress.net/12/svg/' );

foreach ( $hints as $relation_type => $urls ) {
$unique_urls = array();
Expand Down
22 changes: 12 additions & 10 deletions src/wp-includes/js/wp-emoji-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
* the browser doesn't render it correctly ([U] + [N]).
*/
isIdentical = emojiSetsRenderIdentically(
[ 55356, 56826, 55356, 56819 ],
[ 55356, 56826, 8203, 55356, 56819 ]
[ 0xD83C, 0xDDFA, 0xD83C, 0xDDF3 ],
[ 0xD83C, 0xDDFA, 0x200B, 0xD83C, 0xDDF3 ]
);

if ( isIdentical ) {
Expand All @@ -81,22 +81,24 @@
* the browser doesn't render it correctly (black flag emoji + [G] + [B] + [E] + [N] + [G]).
*/
isIdentical = emojiSetsRenderIdentically(
[ 55356, 57332, 56128, 56423, 56128, 56418, 56128, 56421, 56128, 56430, 56128, 56423, 56128, 56447 ],
[ 55356, 57332, 8203, 56128, 56423, 8203, 56128, 56418, 8203, 56128, 56421, 8203, 56128, 56430, 8203, 56128, 56423, 8203, 56128, 56447 ]
[ 0xD83C, 0xDFF4, 0xDB40, 0xDC67, 0xDB40, 0xDC62, 0xDB40, 0xDC65, 0xDB40, 0xDC6E, 0xDB40, 0xDC67, 0xDB40, 0xDC7F ],
[ 0xD83C, 0xDFF4, 0x200B, 0xDB40, 0xDC67, 0x200B, 0xDB40, 0xDC62, 0x200B, 0xDB40, 0xDC65, 0x200B, 0xDB40, 0xDC6E, 0x200B, 0xDB40, 0xDC67, 0x200B, 0xDB40, 0xDC7F ]
);

return ! isIdentical;
case 'emoji':
/*
* She's the hero Emoji deserves, but not the one it needs right now.
* Love is love.
*
* To test for support, try to render a new emoji (female superhero),
* then compare it to how it would look if the browser doesn't render it correctly
* (superhero + female sign).
* To test for Emoji 12 support, try to render a new emoji: men holding hands, with different skin
* tone modifiers.
*
* When updating this test for future Emoji releases, ensure that individual emoji that make up the
* sequence come from older emoji standards.
*/
isIdentical = emojiSetsRenderIdentically(
[55358, 56760, 9792, 65039],
[55358, 56760, 8203, 9792, 65039]
[0xD83D, 0xDC68, 0xD83C, 0xDFFE, 0x200D, 0xD83E, 0xDD1D, 0x200D, 0xD83D, 0xDC68, 0xD83C, 0xDFFC],
[0xD83D, 0xDC68, 0xD83C, 0xDFFE, 0x200B, 0xD83E, 0xDD1D, 0x200B, 0xD83D, 0xDC68, 0xD83C, 0xDFFC]
);
return ! isIdentical;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/formatting/Emoji.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
class Tests_Formatting_Emoji extends WP_UnitTestCase {

private $png_cdn = 'https://twemoji.classicpress.net/11/72x72/';
private $svn_cdn = 'https://twemoji.classicpress.net/11/svg/';
private $png_cdn = 'https://twemoji.classicpress.net/12/72x72/';
private $svn_cdn = 'https://twemoji.classicpress.net/12/svg/';

/**
* @see https://core.trac.wordpress.org/ticket/36525
Expand Down