Opened 4 weeks ago
Closed 4 weeks ago
#63032 closed enhancement (fixed)
Adjust speculative loading selector exclusions to allow for classes to apply on parent element
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch has-unit-tests |
Focuses: | performance | Cc: |
Description
The speculative loading implementation in Core, as one of the lesser discussed features, currently excludes any links from prerendering that use a no-prerender
class on them, and it excludes any links from prefetching that use either a no-prefetch
or a no-prerender
class on them.
In the current implementation, this may be beneficial for some plugins or classic themes, but it misses out on another valuable opportunity, which is block themes. Many blocks allow adding a custom class to the block wrapper element itself, and this would be a perfect candidate to allow advanced end user customization of speculative loading. But there is no UI to add a class to a link (a
) specifically.
While WordPress Core's philosophy is "decisions, not options", the UI to add a class is in itself already considered advanced, so allowing it to control this kind of exclusion would make sense.
And it's an easy win: All we need to do is to also allow the exclusion for .no-prefetch a
and .no-prerender a
, instead of just .no-prefetch
and .no-prerender
.
Also see the related discussion in https://github.com/WordPress/performance/issues/1156#issuecomment-2616505930. It includes additional classes, but those are out of scope for this ticket as they require more discussion. This ticket is merely about "fixing" the current exclusions to be controllable via the block class UI.
Change History (2)
This ticket was mentioned in PR #8428 on WordPress/wordpress-develop by @flixos90.
4 weeks ago
#1
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
Trac ticket: https://core.trac.wordpress.org/ticket/63032