#62629 closed enhancement (fixed)
Begin HTML markup before Customizer script hooks
| Reported by: | sabernhardt | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8 |
| Component: | Customize | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
21 months ago
#1
- Keywords has-patch added
@SergeyBiryukov commented on PR #7930:
21 months ago
#4
Thanks for the PR! Merged in r59480.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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