aboutsummaryrefslogtreecommitdiff
path: root/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-07-27 10:05:23 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-07-27 10:05:23 +0200
commit5bf66662a9bdd62c5bccab15e607cd95cfb8fcab (patch)
tree39a1a4629749056191c05dfd899f931701b7acf3 /srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php
parent5afd237bbd22028b85532b8c0b3fcead49a00764 (diff)
downloadft_server-5bf66662a9bdd62c5bccab15e607cd95cfb8fcab.tar.gz
ft_server-5bf66662a9bdd62c5bccab15e607cd95cfb8fcab.tar.bz2
ft_server-5bf66662a9bdd62c5bccab15e607cd95cfb8fcab.zip
Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my famillyHEADmaster
Diffstat (limited to 'srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php')
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php47
1 files changed, 0 insertions, 47 deletions
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
deleted file mode 100644
index a8af12f..0000000
--- a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Javascript Loader Class
- *
- * Allow `async` and `defer` while enqueuing Javascript.
- *
- * Based on a solution in WP Rig.
- *
- * @package WordPress
- * @subpackage Twenty_Twenty
- * @since 1.0.0
- */
-
-if ( ! class_exists( 'TwentyTwenty_Script_Loader' ) ) {
- /**
- * A class that provides a way to add `async` or `defer` attributes to scripts.
- */
- class TwentyTwenty_Script_Loader {
-
- /**
- * Adds async/defer attributes to enqueued / registered scripts.
- *
- * If #12009 lands in WordPress, this function can no-op since it would be handled in core.
- *
- * @link https://core.trac.wordpress.org/ticket/12009
- *
- * @param string $tag The script tag.
- * @param string $handle The script handle.
- * @return string Script HTML string.
- */
- public function filter_script_loader_tag( $tag, $handle ) {
- foreach ( [ 'async', 'defer' ] as $attr ) {
- if ( ! wp_scripts()->get_data( $handle, $attr ) ) {
- continue;
- }
- // Prevent adding attribute when already added in #12009.
- if ( ! preg_match( ":\s$attr(=|>|\s):", $tag ) ) {
- $tag = preg_replace( ':(?=></script>):', " $attr", $tag, 1 );
- }
- // Only allow async or defer, not both.
- break;
- }
- return $tag;
- }
-
- }
-}