diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index 2df89a9..11d2e5e 100644
|
a
|
b
|
function print_emoji_detection_script() {
|
| 4529 | 4529 | |
| 4530 | 4530 | $settings = array( |
| 4531 | 4531 | /** |
| 4532 | | * Filter the URL where emoji images are hosted. |
| | 4532 | * Filter the URL where emoji png images are hosted. |
| 4533 | 4533 | * |
| 4534 | 4534 | * @since 4.2.0 |
| 4535 | 4535 | * |
| 4536 | | * @param string The emoji base URL. |
| | 4536 | * @param string The emoji base URL for png images. |
| 4537 | 4537 | */ |
| 4538 | 4538 | 'baseUrl' => apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/72x72/' ), |
| 4539 | 4539 | |
| 4540 | 4540 | /** |
| 4541 | | * Filter the extension of the emoji files. |
| | 4541 | * Filter the extension of the emoji png files. |
| 4542 | 4542 | * |
| 4543 | 4543 | * @since 4.2.0 |
| 4544 | 4544 | * |
| 4545 | | * @param string The emoji extension. Default .png. |
| | 4545 | * @param string The emoji extension for png files. Default .png. |
| 4546 | 4546 | */ |
| 4547 | 4547 | 'ext' => apply_filters( 'emoji_ext', '.png' ), |
| | 4548 | |
| | 4549 | /** |
| | 4550 | * Filter the URL where emoji SVG images are hosted. |
| | 4551 | * |
| | 4552 | * @since 4.2.0 |
| | 4553 | * |
| | 4554 | * @param string The emoji base URL for svg images. |
| | 4555 | */ |
| | 4556 | 'svgUrl' => apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/svg/' ), |
| | 4557 | |
| | 4558 | /** |
| | 4559 | * Filter the extension of the emoji SVG files. |
| | 4560 | * |
| | 4561 | * @since 4.2.0 |
| | 4562 | * |
| | 4563 | * @param string The emoji extension for svg files. Default .svg. |
| | 4564 | */ |
| | 4565 | 'svgExt' => apply_filters( 'emoji_svg_ext', '.svg' ), |
| 4548 | 4566 | ); |
| 4549 | 4567 | |
| 4550 | 4568 | $version = 'ver=' . $wp_version; |
diff --git a/src/wp-includes/js/wp-emoji.js b/src/wp-includes/js/wp-emoji.js
index dafcc36..4156f01 100644
|
a
|
b
|
|
| 3 | 3 | function wpEmoji() { |
| 4 | 4 | var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver, |
| 5 | 5 | |
| | 6 | // Compression and maintain local scope |
| | 7 | document = window.document, |
| | 8 | |
| 6 | 9 | // Private |
| 7 | 10 | twemoji, timer, |
| 8 | 11 | loaded = false, |
| … |
… |
|
| 10 | 13 | ie11 = window.navigator.userAgent.indexOf( 'Trident/7.0' ) > 0; |
| 11 | 14 | |
| 12 | 15 | /** |
| | 16 | * Detect if the browser supports SVG. |
| | 17 | * |
| | 18 | * @since 4.6.0 |
| | 19 | * |
| | 20 | * @return {Boolean} True if the browser supports svg, false if not. |
| | 21 | */ |
| | 22 | function browserSupportsSvgAsImage() { |
| | 23 | if ( !! document.implementation.hasFeature ) { |
| | 24 | // Source: Modernizr |
| | 25 | // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/svg/asimg.js |
| | 26 | return document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ); |
| | 27 | } |
| | 28 | |
| | 29 | // document.implementation.hasFeature is deprecated. It can be presumed |
| | 30 | // if future browsers remove it, the browser will support SVGs as images. |
| | 31 | return true; |
| | 32 | } |
| | 33 | |
| | 34 | /** |
| 13 | 35 | * Runs when the document load event is fired, so we can do our first parse of the page. |
| 14 | 36 | * |
| 15 | 37 | * @since 4.2.0 |
| … |
… |
|
| 141 | 163 | |
| 142 | 164 | args = args || {}; |
| 143 | 165 | params = { |
| 144 | | base: settings.baseUrl, |
| 145 | | ext: settings.ext, |
| | 166 | base: browserSupportsSvgAsImage() ? settings.svgUrl : settings.baseUrl, |
| | 167 | ext: browserSupportsSvgAsImage() ? settings.svgExt : settings.ext, |
| 146 | 168 | className: args.className || 'emoji', |
| 147 | 169 | callback: function( icon, options ) { |
| 148 | 170 | // Ignore some standard characters that TinyMCE recommends in its character map. |