Make WordPress Core

Changeset 39050


Ignore:
Timestamp:
10/31/2016 06:16:15 AM (10 years ago)
Author:
peterwilsoncc
Message:

Themes: Exit wp-custom-header.js early in browsers wihout modern events.

Adds a check for window.addEventListener support before attempting to use it. In browsers without support, the file is exited early to avoid throwing a JavaScript error.

Fixes #38585.

File:
1 edited

Legend:

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

    r38985 r39050  
    11(function( window, $, settings ) {
     2
     3        if ( ! ( 'addEventListener' in window ) ) {
     4                // Fail gracefully in unsupported browsers.
     5                return;
     6        }
    27
    38        function wpCustomHeader() {
Note: See TracChangeset for help on using the changeset viewer.