Skip to Content
Menu

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.

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

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

    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) && !is_admin_bar_showing() && $this->get_option('jquery_location') !== '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?