#62629 closed enhancement (fixed)
Begin HTML markup before Customizer script hooks
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.8 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Customize | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Related: #62491
Styles and scripts that plugins might output in the admin_enqueue_scripts hook is added before the <!DOCTYPE> in the Customizer. The resulting potential for invalid HTML has existed at least as early as 5.0 (and likely back to [27907]).
Steps:
- Activate a classic theme, such as Twenty Twenty.
- Output a style or script tag in the
admin_enqueue_scriptshook (sample code snippet) inside a (custom) plugin. - Go to the Customizer.
- If your browser lets you view the full page source, check it to find your special tag before
<!DOCTYPE>. If you can only use the inspect element tool, you will likely find your tag in the<head>(before thehttp-equivmeta).
Change History (4)
This ticket was mentioned in PR #7930 on WordPress/wordpress-develop by @sabernhardt.
13 months ago
#1
- Keywords has-patch added
#2
@
13 months ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 59480:
@SergeyBiryukov commented on PR #7930:
13 months ago
#4
Thanks for the PR! Merged in r59480.
Note: See
TracTickets for help on using
tickets.
Prevents printing styles and scripts before the
<!DOCTYPE>.The
_wp_admin_html_begin()function could precede Customizer script hooks, in case a plugin prints markup inside a hook such asadmin_enqueue_scripts.Trac 62629