For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Friday, February 24, 2017

How to remove jQuery migrate from WordPress


How to remove jQuery migrate from WordPress.


It is important to preserve jquery_migrate file in Admin section. 
You can remove it from client section if it is not creating any issues, because it load unnecessary in client section.
 
Below are the only 4 lines of code which you needed to paste in your theme's function.php file.




<?php

add_filter( 'wp_default_scripts', 'dequeue_jquery_migrate' );
function dequeue_jquery_migrate( &$scripts){
if(!is_admin()){ $scripts->remove( 'jquery');

 $scripts->add( 'jquery', false, array( 'jquery-core' ), '1.10.2' ); } } 


?>







Share:

0 comments:

Post a Comment

Add Dependent Scripts

   here is the code that allow to add dependent script :         <script>         const addDependentScripts = async function( scriptsT...

Ads Inside Post

Powered by Blogger.

Arsip