mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 12:14:25 +00:00
Emoji: Instead of loading the emoji JS files automatically, we now include a small JS shim in the header, to test if the user's browser needs Twemoji. It then loads the emoji JS files only if they're needed.
Props pento, azaozz. Fixes #31701. git-svn-id: https://develop.svn.wordpress.org/trunk@31875 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -424,29 +424,6 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'media-audiovideo', "/wp-includes/js/media/audio-video$suffix.js", array( 'media-editor' ), false, 1 );
|
||||
$scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models', 'media-audiovideo', 'wp-playlist' ), false, 1 );
|
||||
|
||||
$scripts->add( 'twemoji', "/wp-includes/js/twemoji$suffix.js", array(), '1.3.2', 1 );
|
||||
$scripts->add( 'emoji', "/wp-includes/js/wp-emoji$suffix.js", array( 'twemoji' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'emoji', '_wpemojiSettings', array(
|
||||
/**
|
||||
* Filter the URL where emoji images are hosted.
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @param string The emoji base URL.
|
||||
*/
|
||||
'baseUrl' => apply_filters( 'emoji_url', '//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72' ),
|
||||
|
||||
/**
|
||||
* Filter the extension of the emoji files.
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @param string The emoji extension. Default .png.
|
||||
*/
|
||||
'ext' => apply_filters( 'emoji_ext', '.png' ),
|
||||
) );
|
||||
$scripts->enqueue( 'emoji' );
|
||||
|
||||
if ( is_admin() ) {
|
||||
$scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
|
||||
|
||||
Reference in New Issue
Block a user