Skip to content

Instantly share code, notes, and snippets.

@KeSch
Created August 10, 2014 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KeSch/781d1849634dc77a2d00 to your computer and use it in GitHub Desktop.
Save KeSch/781d1849634dc77a2d00 to your computer and use it in GitHub Desktop.
Toolbox-Modul um das Laden des jQuery-migrate Files zu verhindern.
<?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