Skip to content

Commit

Permalink
Merge pull request #11608 from Yoast/11597-fix-IE11-react-error
Browse files Browse the repository at this point in the history
Add wp-polyfill as dependency to react to fix IE11 bug
  • Loading branch information
IreneStr authored Nov 15, 2018
2 parents 498ae1e + e0d2bd5 commit 36e4cd2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions admin/class-admin-asset-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ public static function create_default_location() {
* @return void
*/
public function register_wp_assets() {

global $wp_scripts;

$script = $wp_scripts->query( 'react' );

// IE11 needs wp-polyfill to be registered before react.
if ( $script && ! in_array( 'wp-polyfill', $script->deps, true ) ) {
$script->deps[] = 'wp-polyfill';
}

$flat_version = $this->flatten_version( WPSEO_VERSION );

wp_register_script( 'lodash-base', plugins_url( 'js/vendor/lodash.min.js', WPSEO_FILE ), array(), false, true );
Expand Down

0 comments on commit 36e4cd2

Please sign in to comment.