Sfoglia il codice sorgente

feat: removed jquery for visitors

tags/0.9.0
J 6 anni fa
parent
commit
178f653f47
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9
    0
      vue-theme/functions.php

+ 9
- 0
vue-theme/functions.php Vedi File

@@ -141,5 +141,14 @@ function remove_cssjs_ver( $src ) {
141 141
 add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
142 142
 add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
143 143
 
144
+// Do NOT include jquery
145
+function no_default_jquery( ) {
146
+    if (!is_admin()) {
147
+        wp_deregister_script('jquery');
148
+        wp_register_script('jquery', false);
149
+    }
150
+}
151
+add_action( 'init', 'no_default_jquery' );
152
+
144 153
 // header( 'Access-Control-Allow-Origin: http://localhost:8080' );
145 154
 header( 'Content-Type: application/json' );

Loading…
Annulla
Salva