From 741a914df39cafc0d609d6efb539204695902ee1 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Thu, 27 Feb 2025 22:14:25 +0000 Subject: [PATCH] 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 --- wp-includes/speculative-loading.php | 8 ++++---- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/speculative-loading.php b/wp-includes/speculative-loading.php index ee9d4b6381..2a06bc4aea 100644 --- a/wp-includes/speculative-loading.php +++ b/wp-includes/speculative-loading.php @@ -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', ), ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 0cfba1c818..505b719863 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.