Created
August 10, 2014 12:26
-
-
Save KeSch/781d1849634dc77a2d00 to your computer and use it in GitHub Desktop.
Toolbox-Modul um das Laden des jQuery-migrate Files zu verhindern.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Module Name: Entferne jQuery-migrate File | |
Description: Laden des jQuery-migrate files in WordPress verhindern. [Frontend] | |
Author: Kevin Schludermann | |
Author URI: http://kevinschludermann.com | |
*/ | |
/* Sicherheitsabfrage */ | |
if ( !class_exists('Toolbox') ) { | |
die(); | |
} | |
/* remove_jquery-Funktion in den WordPress Skriptaufruf einbinden */ | |
add_filter( 'wp_default_scripts', 'ks_remove_jquery_migrate' ); | |
function ks_remove_jquery_migrate( &$scripts) { | |
if(!is_admin()) | |
{ | |
/* Alle jQuery-Files entfernen */ | |
$scripts->remove( 'jquery'); | |
/* Nur den jQuery-Core (ohne migrate-File) laden */ | |
$scripts->add( 'jquery', false, array( 'jquery-core' ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment