Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#34444 closed defect (bug) (fixed)

Move print_embed_scripts to run on the embed_footer action

Reported by: peterwilsoncc's profile peterwilsoncc Owned by:
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.4
Component: Embeds Keywords: good-first-bug has-patch
Focuses: javascript Cc:

Description

print_embed_scripts currently runs on the embed_head action and prints the inline JavaScript in the HTML header of the embed template.

As the JavaScript runs on the DOMContentLoaded event, it can be moved the the HTML footer and run on the embed_footer action.

Attachments (2)

34444.1.diff (923 bytes) - added by brainstormforce 10 years ago.
Moved print_embed_scripts to run on the embed_footer action.
34444.2.diff (1.2 KB) - added by pratikchaskar 10 years ago.
Patch refreshed, moved add_action() call next to the other embed_footer action

Download all attachments as: .zip

Change History (7)

#1 @pento
10 years ago

  • Milestone changed from Awaiting Review to 4.4

@brainstormforce
10 years ago

Moved print_embed_scripts to run on the embed_footer action.

#2 @brainstormforce
10 years ago

  • Keywords has-patch added; needs-patch removed

#3 @pento
10 years ago

  • Keywords needs-refresh added

Thanks for the patch, @brainstormforce!

To keep it in line with the surrounding, code, the add_action() call should also be moved further down in the file, next to the other embed_footer action.

@pratikchaskar
10 years ago

Patch refreshed, moved add_action() call next to the other embed_footer action

#4 @pratikchaskar
10 years ago

  • Keywords needs-refresh removed

#5 @pento
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Fixed by [35395].

Note: See TracTickets for help on using tickets.