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: mcr2582 Owned by: sorich87
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)

14488.diff (616 bytes) - added by sorich87 3 years ago.
14488.patch (650 bytes) - added by SergeyBiryukov 21 months ago.

Download all attachments as: .zip

Change History (9)

  • Milestone changed from Awaiting Review to 3.1
  • Cc sorich87@… added
  • Keywords has-patch added; JS footer enqueue removed
  • Owner set to sorich87
  • Status changed from new to accepted
  • Milestone changed from 3.1 to Future Release

Don't think is_footer is the right check.

I think is_footer is actually correct there. Would be nice to have this sorted out.

Simplified the patch a bit.

tested and confirmed the patch works.

  • Cc mdhansen@… added
Note: See TracTickets for help on using tickets.