Commit 05ec399a62 for wordpress.org
commit 05ec399a6290c57fd981f0fadfb4dc53fc5e4b9c
Author: westonruter <westonruter@git.wordpress.org>
Date: Wed Nov 25 07:10:42 2026 +0000
Code Quality: Call `process_blocks_custom_css()` statically.
The `WP_Theme_JSON::process_blocks_custom_css()` method is declared static, yet three of its call sites invoked it through `$this` while the others already used `static::`. Behavior is unchanged, since both forms resolve the method with late static binding. In Gutenberg the same change, made in https://github.com/WordPress/gutenberg/pull/87058, cleared the only errors of the `dynamicCallOnStaticMethod` rule from phpstan-strict-rules, so making it here keeps `WP_Theme_JSON` in sync with its Gutenberg counterpart.
Developed in https://github.com/WordPress/wordpress-develop/pull/16093.
Follow-up to r55192, r58421.
Props noruzzaman, westonruter.
See #66739.
Built from https://develop.svn.wordpress.org/trunk@65770
git-svn-id: http://core.svn.wordpress.org/trunk@64799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php
index 15d08fba45..f432b45ab4 100644
--- a/wp-includes/class-wp-theme-json.php
+++ b/wp-includes/class-wp-theme-json.php
@@ -2283,7 +2283,7 @@ class WP_Theme_JSON {
$custom_block_css = $this->theme_json['styles']['blocks'][ $name ]['css'] ?? null;
if ( $custom_block_css ) {
$selector = static::$blocks_metadata[ $name ]['selector'];
- $stylesheet .= $this->process_blocks_custom_css( $custom_block_css, $selector );
+ $stylesheet .= static::process_blocks_custom_css( $custom_block_css, $selector );
}
}
}
@@ -4202,7 +4202,7 @@ class WP_Theme_JSON {
// Store custom CSS for the style variation.
if ( isset( $style_variation_node['css'] ) ) {
- $style_variation_custom_css[ $style_variation['selector'] ] = $this->process_blocks_custom_css( $style_variation_node['css'], $variation_css_selector );
+ $style_variation_custom_css[ $style_variation['selector'] ] = static::process_blocks_custom_css( $style_variation_node['css'], $variation_css_selector );
}
// Store variation metadata and node for layout styles generation.
@@ -4534,7 +4534,7 @@ class WP_Theme_JSON {
// 7. Generate and append any custom CSS rules.
if ( isset( $node['css'] ) && ! $is_root_selector ) {
$css_selector = $css_feature_selector ?? $selector;
- $block_rules .= $this->process_blocks_custom_css( $node['css'], $css_selector );
+ $block_rules .= static::process_blocks_custom_css( $node['css'], $css_selector );
}
// 8. Wrap the entire block output in a media query if this is a responsive node.
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 99d61feb2e..4eb45524c5 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.3-alpha-65769';
+$wp_version = '7.3-alpha-65770';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.