Skip to Content

remove_jquery_migrate()

Removes jQuery Migrate (but keeps jQuery)

PHP April 26, 2017

Usage

This function runs automatically, so it is not called manually. Is this incorrect?

Additional Notes

jQuery is registered with jQuery Migrate, so WordPress (by default) enqueues them both. This function dequeues both, and then re-enqueues jQuery alone.

Source File

Located in /libs/Optimization.php on line 738.

No Hooks

This function does not have any filters or actions available. Request one?
PHP
        public function remove_jquery_migrate($scripts){
            if ( !$this->is_admin_page(true) && $this->get_option('jquery_version') !== 'wordpress' ){
                $scripts->remove('jquery');
                $scripts->add('jquery', false, array('jquery-core'), null);
            }
        }

Override

This function can not be short-circuited with an override filter. Request one?