WordPress<\/a>!<\/p>$/',
+ 'expected_markup' => '/^Hello WordPress<\/a>!<\/p>$/',
),
);
}
diff --git a/tests/phpunit/tests/block-supports/wpRenderElementsSupportStyles.php b/tests/phpunit/tests/block-supports/wpRenderElementsSupportStyles.php
index 16ed26fc9c7bc..5c9fc8af5819d 100644
--- a/tests/phpunit/tests/block-supports/wpRenderElementsSupportStyles.php
+++ b/tests/phpunit/tests/block-supports/wpRenderElementsSupportStyles.php
@@ -68,6 +68,62 @@ public function test_elements_block_support_styles( $color_settings, $elements_s
);
}
+ /**
+ * Tests that identical blocks with different elements styles
+ * generate distinct class names to avoid CSS cascade conflicts.
+ *
+ * @ticket 65435
+ *
+ * @covers ::wp_get_elements_class_name
+ */
+ public function test_elements_block_support_styles_with_duplicate_blocks(): void {
+ $this->test_block_name = 'test/element-block-supports';
+
+ register_block_type(
+ $this->test_block_name,
+ array(
+ 'api_version' => 3,
+ 'attributes' => array(
+ 'style' => array(
+ 'type' => 'object',
+ ),
+ ),
+ 'supports' => array(
+ 'color' => array(
+ 'link' => true,
+ ),
+ ),
+ )
+ );
+
+ $block = array(
+ 'blockName' => $this->test_block_name,
+ 'attrs' => array(
+ 'style' => array(
+ 'elements' => array(
+ 'link' => array(
+ 'color' => array(
+ 'text' => 'blue',
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+
+ // Process two identical blocks with the same elements styles.
+ $count = 2;
+ for ( $i = 0; $i < $count; $i++ ) {
+ wp_render_elements_support_styles( $block );
+ }
+ $actual_stylesheet = wp_style_engine_get_stylesheet_from_context( 'block-supports', array( 'prettify' => false ) );
+
+ // Count the number of distinct class names to confirm uniqueness.
+ $this->assertSame( $count, preg_match_all( '/\.wp-elements-(\d+)/', $actual_stylesheet, $matches ) );
+ $unique_classes = array_unique( $matches[1] );
+ $this->assertCount( $count, $unique_classes, 'Both blocks should produce distinct class names' );
+ }
+
/**
* Data provider.
*
@@ -127,7 +183,7 @@ public function data_elements_block_support_styles() {
'elements_styles' => array(
'button' => array( 'color' => $color_styles ),
),
- 'expected_styles' => '/^.wp-elements-[a-f0-9]{32} .wp-element-button, .wp-elements-[a-f0-9]{32} .wp-block-button__link' . $color_css_rules . '$/',
+ 'expected_styles' => '/^.wp-elements-\d+ .wp-element-button, .wp-elements-\d+ .wp-block-button__link' . $color_css_rules . '$/',
),
'link element styles are applied' => array(
'color_settings' => array( 'link' => true ),
@@ -139,15 +195,15 @@ public function data_elements_block_support_styles() {
),
),
),
- 'expected_styles' => '/^.wp-elements-[a-f0-9]{32} a:where\(:not\(.wp-element-button\)\)' . $color_css_rules .
- '.wp-elements-[a-f0-9]{32} a:where\(:not\(.wp-element-button\)\):hover' . $color_css_rules . '$/',
+ 'expected_styles' => '/^.wp-elements-\d+ a:where\(:not\(.wp-element-button\)\)' . $color_css_rules .
+ '.wp-elements-\d+ a:where\(:not\(.wp-element-button\)\):hover' . $color_css_rules . '$/',
),
'generic heading element styles are applied' => array(
'color_settings' => array( 'heading' => true ),
'elements_styles' => array(
'heading' => array( 'color' => $color_styles ),
),
- 'expected_styles' => '/^.wp-elements-[a-f0-9]{32} h1, .wp-elements-[a-f0-9]{32} h2, .wp-elements-[a-f0-9]{32} h3, .wp-elements-[a-f0-9]{32} h4, .wp-elements-[a-f0-9]{32} h5, .wp-elements-[a-f0-9]{32} h6' . $color_css_rules . '$/',
+ 'expected_styles' => '/^.wp-elements-\d+ h1, .wp-elements-\d+ h2, .wp-elements-\d+ h3, .wp-elements-\d+ h4, .wp-elements-\d+ h5, .wp-elements-\d+ h6' . $color_css_rules . '$/',
),
'individual heading element styles are applied' => array(
'color_settings' => array( 'heading' => true ),
@@ -159,12 +215,12 @@ public function data_elements_block_support_styles() {
'h5' => array( 'color' => $color_styles ),
'h6' => array( 'color' => $color_styles ),
),
- 'expected_styles' => '/^.wp-elements-[a-f0-9]{32} h1' . $color_css_rules .
- '.wp-elements-[a-f0-9]{32} h2' . $color_css_rules .
- '.wp-elements-[a-f0-9]{32} h3' . $color_css_rules .
- '.wp-elements-[a-f0-9]{32} h4' . $color_css_rules .
- '.wp-elements-[a-f0-9]{32} h5' . $color_css_rules .
- '.wp-elements-[a-f0-9]{32} h6' . $color_css_rules . '$/',
+ 'expected_styles' => '/^.wp-elements-\d+ h1' . $color_css_rules .
+ '.wp-elements-\d+ h2' . $color_css_rules .
+ '.wp-elements-\d+ h3' . $color_css_rules .
+ '.wp-elements-\d+ h4' . $color_css_rules .
+ '.wp-elements-\d+ h5' . $color_css_rules .
+ '.wp-elements-\d+ h6' . $color_css_rules . '$/',
),
);
}
From c710ca6b53db970d1b59b4e34ba130b25458ec1b Mon Sep 17 00:00:00 2001
From: Weston Ruter
Date: Thu, 18 Jun 2026 02:04:14 +0000
Subject: [PATCH 9/9] Embeds: Replace the blue site icon fallback with the gray
WordPress logo.
Adds gray WordPress logo image files (`w-logo-gray-white-bg.png` and `w-logo-gray-white-bg.svg`) to `wp-includes/images/`, and updates `the_embed_site_title()` and `do_favicon()` to use the new images as the fallback site icon, maintaining visual consistency with the login screen logo updated in r61989.
Replaces CSS custom property references for focus styles in the embed template (`--wp-admin-theme-color` and `--wp-admin-border-width-focus`) with their literal values, as these admin-theme variables are not defined in the oEmbed template context.
Developed in https://github.com/WordPress/wordpress-develop/pull/11293.
Follow-up to r61652, r61989, r62502.
Props sabernhardt, huzaifaalmesbah, westonruter, jamesbregenzer.
See #64708.
Fixes #64877.
git-svn-id: https://develop.svn.wordpress.org/trunk@62521 602fd350-edb4-49c9-b593-d223f7449a82
---
src/wp-includes/css/wp-embed-template.css | 2 +-
src/wp-includes/embed.php | 2 +-
src/wp-includes/functions.php | 2 +-
src/wp-includes/images/w-logo-gray-white-bg.png | Bin 0 -> 3241 bytes
src/wp-includes/images/w-logo-gray-white-bg.svg | 1 +
tests/phpunit/tests/general/template.php | 4 ++--
6 files changed, 6 insertions(+), 5 deletions(-)
create mode 100644 src/wp-includes/images/w-logo-gray-white-bg.png
create mode 100644 src/wp-includes/images/w-logo-gray-white-bg.svg
diff --git a/src/wp-includes/css/wp-embed-template.css b/src/wp-includes/css/wp-embed-template.css
index 6118ab4d2b6d1..9bf606589a773 100644
--- a/src/wp-includes/css/wp-embed-template.css
+++ b/src/wp-includes/css/wp-embed-template.css
@@ -217,7 +217,7 @@ p.wp-embed-heading {
.wp-embed-share-dialog-open:focus .dashicons,
.wp-embed-share-dialog-close:focus .dashicons {
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color, #3858e9);
+ box-shadow: 0 0 0 1.5px #3858e9;
/* Only visible in Windows High Contrast mode */
outline: 2px solid transparent;
border-radius: 100%;
diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php
index 636f6acd94e6b..10558caed6f8c 100644
--- a/src/wp-includes/embed.php
+++ b/src/wp-includes/embed.php
@@ -1233,7 +1233,7 @@ function print_embed_sharing_dialog() {
* @since 4.5.0
*/
function the_embed_site_title(): void {
- $fallback_icon_url = includes_url( 'images/w-logo-blue.png' );
+ $fallback_icon_url = includes_url( 'images/w-logo-gray-white-bg.svg' );
$site_icon_url = get_site_icon_url( 32, $fallback_icon_url );
$icon_img = '';
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index c297864859aa4..d7d2ff3fed89a 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -1752,7 +1752,7 @@ function do_favicon() {
*/
do_action( 'do_faviconico' );
- wp_redirect( get_site_icon_url( 32, includes_url( 'images/w-logo-blue-white-bg.png' ) ) );
+ wp_redirect( get_site_icon_url( 32, includes_url( 'images/w-logo-gray-white-bg.png' ) ) );
exit;
}
diff --git a/src/wp-includes/images/w-logo-gray-white-bg.png b/src/wp-includes/images/w-logo-gray-white-bg.png
new file mode 100644
index 0000000000000000000000000000000000000000..0adbfad427550458fbaf46ba929a119201daed27
GIT binary patch
literal 3241
zcmV;a3|8}rP)d?@At9_1
zjN|d5=>kurPzk$=OjZ!
z9o2TFB#w&hoqNAGTMpyiv`%0FpmyBvr-6#I{_1C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(M6hC*$S
z(PMysq+Ai^wl{$-xjN9mSn9{XqVvXTgRBAbuoKdV8@?;58*kW@8Nhn(8gc6c$D(l3
zJFFEv`8sNK?91ESUNWoFPwM9ypSxD@A*=*|?asIV8A0L<4gK#hcI|4&&Cln`>c7MI
bzW@UO^iA1I4jy`S00000NkvXXu0mjfq?$19
literal 0
HcmV?d00001
diff --git a/src/wp-includes/images/w-logo-gray-white-bg.svg b/src/wp-includes/images/w-logo-gray-white-bg.svg
new file mode 100644
index 0000000000000..6cb698ca9a607
--- /dev/null
+++ b/src/wp-includes/images/w-logo-gray-white-bg.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/phpunit/tests/general/template.php b/tests/phpunit/tests/general/template.php
index 20f6d0012b3a7..00b683971a6a0 100644
--- a/tests/phpunit/tests/general/template.php
+++ b/tests/phpunit/tests/general/template.php
@@ -860,7 +860,7 @@ public function test_the_embed_site_title_uses_fallback_when_attachment_url_fail
add_filter( 'wp_get_attachment_image_src', '__return_false' );
$output = get_echo( 'the_embed_site_title' );
- $fallback = includes_url( 'images/w-logo-blue.png' );
+ $fallback = includes_url( 'images/w-logo-gray-white-bg.svg' );
$processor = new WP_HTML_Tag_Processor( $output );
$this->assertTrue( $processor->next_tag( 'IMG' ), 'Expected IMG tag with fallback.' );
@@ -914,7 +914,7 @@ public function test_the_embed_site_title_omits_srcset_when_1x_and_2x_urls_are_i
*/
public function test_the_embed_site_title_uses_fallback_without_srcset_when_no_site_icon_set(): void {
$output = get_echo( 'the_embed_site_title' );
- $fallback = includes_url( 'images/w-logo-blue.png' );
+ $fallback = includes_url( 'images/w-logo-gray-white-bg.svg' );
$processor = new WP_HTML_Tag_Processor( $output );