Skip to content

Commit

Permalink
Fix issue Automattic#8546 - remove window.require and window.define f…
Browse files Browse the repository at this point in the history
…rom global scope after using a require definition
  • Loading branch information
adamziel committed Jan 17, 2018
1 parent ac952d5 commit a0966bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/shortcodes/mailchimp.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ static function shortcode( $lcase_attrs ) {

$displayed_once = true;

return "\n\n" . '<script type="text/javascript" data-dojo-config="' . esc_attr( implode( ', ', $config_vars ) ) . '">jQuery.getScript( "//downloads.mailchimp.com/js/signup-forms/popup/embed.js", function( data, textStatus, jqxhr ) { require(["mojo/signup-forms/Loader"], function(L) { L.start(' . wp_json_encode( $js_vars ) . ') }); } );</script>' . "\n\n";
return "\n\n" . '<script type="text/javascript" data-dojo-config="' . esc_attr( implode( ', ', $config_vars ) ) . '">jQuery.getScript( "//downloads.mailchimp.com/js/signup-forms/popup/embed.js", function( data, textStatus, jqxhr ) { require(["mojo/signup-forms/Loader"], function(L) { L.start(' . wp_json_encode( $js_vars ) . ') }); window.require = window.define = undefined; } );</script>' . "\n\n";
}
}

0 comments on commit a0966bb

Please sign in to comment.