From 5605ba74d343ae0430feb9c80d8da68a515d2c7d Mon Sep 17 00:00:00 2001 From: metodiew Date: Wed, 1 Jul 2020 16:26:47 +0300 Subject: Initial commit of .gitignore and wp-content directory --- .../classes/class-twentytwenty-script-loader.php | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php (limited to 'wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php') diff --git a/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php b/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php new file mode 100644 index 0000000..8a58354 --- /dev/null +++ b/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php @@ -0,0 +1,47 @@ +get_data( $handle, $attr ) ) { + continue; + } + // Prevent adding attribute when already added in #12009. + if ( ! preg_match( ":\s$attr(=|>|\s):", $tag ) ) { + $tag = preg_replace( ':(?=>):', " $attr", $tag, 1 ); + } + // Only allow async or defer, not both. + break; + } + return $tag; + } + + } +} -- cgit v1.3.1-26-gb76a