Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move registered jQuery to the document footer #66

Open
cjg89 opened this issue May 12, 2021 · 0 comments
Open

Move registered jQuery to the document footer #66

cjg89 opened this issue May 12, 2021 · 0 comments
Assignees
Milestone

Comments

@cjg89
Copy link
Member

cjg89 commented May 12, 2021

Description

See title. We currently register it in the document head, but since we've made updates to our plugins that register custom JS to load them late + in the footer, and now that Gravity Forms 2.5+ supports jQuery in the footer, we should no longer need to do this.

If we do experience breakage with plugin JS after moving jQuery down, we need to just update said plugin(s) to ensure they properly register jquery as a dependency when they're enqueued.

Why it's Important

jQuery is a big file; moving it to the footer is one less (significant) blocking request when loading frontend content.

Alternatives

n/a

Possible Implementation

Update false to true here, and update function comments:

wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js', null, null, false );

Additional context

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants