WordPress.org

Make WordPress Core

Changeset 31780


Ignore:
Timestamp:
03/15/2015 12:16:47 AM (6 years ago)
Author:
azaozz
Message:

Emoji: always export the methods in wp-emoji.js, even when dependencies are missing and we cannot initialize.
See #31242.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/wp-emoji.js

    r31779 r31780  
    155155        }
    156156
    157         if ( ! twemoji || ! settings ) {
    158             return;
    159         }       
    160 
    161157        /**
    162158         * Initialize our emoji support, and set up listeners.
    163159         */
    164         parseAllEmoji = ! browserSupportsEmoji();
    165         parseFlags = ! browserSupportsEmoji( 'flag' );
    166         parseEmoji = parseAllEmoji || parseFlags;
    167 
    168         if ( window.addEventListener ) {
    169             window.addEventListener( 'load', load, false );
    170         } else if ( window.attachEvent ) {
    171             window.attachEvent( 'onload', load );
     160        if ( twemoji && settings ) {
     161            parseAllEmoji = ! browserSupportsEmoji();
     162            parseFlags = ! browserSupportsEmoji( 'flag' );
     163            parseEmoji = parseAllEmoji || parseFlags;
     164   
     165            if ( window.addEventListener ) {
     166                window.addEventListener( 'load', load, false );
     167            } else if ( window.attachEvent ) {
     168                window.attachEvent( 'onload', load );
     169            }
    172170        }
    173171
Note: See TracChangeset for help on using the changeset viewer.