[wp-trac] [WordPress Trac] #64361: Leverage HTML API to implement block template skip link (was: Skip Link Minification)
WordPress Trac
noreply at wordpress.org
Fri Dec 5 01:16:28 UTC 2025
#64361: Leverage HTML API to implement block template skip link
-------------------------+--------------------------------------
Reporter: Slieptsov | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 7.0
Component: Themes | Version: 5.8
Severity: normal | Resolution:
Keywords: | Focuses: javascript, performance
-------------------------+--------------------------------------
Changes (by westonruter):
* focuses: => javascript, performance
* component: General => Themes
* version: => 5.8
* milestone: Awaiting Review => 7.0
Old description:
> Hi,
>
> Can skip link CSS/JS be minified?
>
> https://github.com/WordPress/wordpress-
> develop/blob/0b50baa5d164bedd17d3ae9e2eafc6286d6255b6/src/wp-includes
> /theme-templates.php#L172
>
> Kind regards
New description:
When `the_block_template_skip_link()` (now
`wp_enqueue_block_template_skip_link()`) was introduced in #53176 there
was no HTML API which necessitated JavaScript to add the skip link. This
can now be revisited to leverage `WP_HTML_Tag_Processor` to add the skip
link.
The inline JavaScript can then be eliminated.
The CSS should also be minified.
----
Can skip link CSS/JS be minified?
https://github.com/WordPress/wordpress-
develop/blob/0b50baa5d164bedd17d3ae9e2eafc6286d6255b6/src/wp-includes
/theme-templates.php#L172
--
Comment:
What's more is that I don't think this needs to use JavaScript at all
anymore. The HTML API can be used to make the markup modifications. This
could be done in `get_the_block_template_html()`.
This was first introduced in r51003 (#53176) and was revisited in r56932
(#59505).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64361#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list