Opened 3 years ago
Last modified 7 months ago
#14488 accepted defect (bug)
wp_enqueue_script in_footer doesn't work on WP known scripts
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | General | Version: | 3.0.1 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | sorich87@…, mdhansen@… |
Description
I changed some plugin code from:
wp_enqueue_script('jquery-ui-sortable');
To:
wp_enqueue_script('jquery-ui-sortable',false,array(),false,true);
However, the script was not moved to the footer.
When I looked at the source for wp_enqueue_script, I can see that it's because the check for $in_footer is inside the condition for $src being defined. But built-in scripts don't require a source.
Attachments (2)
Change History (9)
- Cc sorich87@… added
- Keywords has-patch added; JS footer enqueue removed
- Owner set to sorich87
- Status changed from new to accepted
comment:4
mitchoyoshitaka — 2 years ago
I think is_footer is actually correct there. Would be nice to have this sorted out.
SergeyBiryukov — 21 months ago
comment:5
SergeyBiryukov — 21 months ago
Simplified the patch a bit.
comment:6
MikeHansenMe — 7 months ago
tested and confirmed the patch works.
comment:7
MikeHansenMe — 7 months ago
- Cc mdhansen@… added
Note: See
TracTickets for help on using
tickets.

Don't think is_footer is the right check.