From 7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 7 Jan 2020 13:06:14 +0100 Subject: Added wordpress --- .../classes/class-twentytwenty-script-loader.php | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php (limited to 'srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php') diff --git a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php b/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php new file mode 100644 index 0000000..a8af12f --- /dev/null +++ b/srcs/wordpress/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