General: Allow speculative loading opt-out CSS classes to be applied on parent element, e.g. at the block level.

Follow-up to [59837].

Props flixos90, westonruter.
Fixes #63032.
See #62503.

Built from https://develop.svn.wordpress.org/trunk@59881


git-svn-id: http://core.svn.wordpress.org/trunk@59223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz
2025-02-27 22:14:25 +00:00
parent b6a0684402
commit 741a914df3
2 changed files with 5 additions and 5 deletions

View File

@@ -190,19 +190,19 @@ function wp_get_speculation_rules(): ?WP_Speculation_Rules {
'selector_matches' => 'a[rel~="nofollow"]',
),
),
// Also exclude links that are explicitly marked to opt out.
// Also exclude links that are explicitly marked to opt out, either directly or via a parent element.
array(
'not' => array(
'selector_matches' => ".no-{$mode}",
'selector_matches' => ".no-{$mode}, .no-{$mode} a",
),
),
);
// If using 'prerender', also exclude links that opt-out of 'prefetch' because it's part of 'prerender'.
// If using 'prerender', also exclude links that opt out of 'prefetch' because it's part of 'prerender'.
if ( 'prerender' === $mode ) {
$main_rule_conditions[] = array(
'not' => array(
'selector_matches' => '.no-prefetch',
'selector_matches' => '.no-prefetch, .no-prefetch a',
),
);
}

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59880';
$wp_version = '6.8-alpha-59881';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.