From da16f2b535a11e9bdd56df78669a123987a208a7 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Tue, 29 Mar 2022 09:12:06 +0000 Subject: [PATCH] Themes: Avoid undefined variable warning on `get_svg_filters()`. This change fixes an undefined variable warning thrown when `duotone` color setting was set to null in Block Themes `theme.json` file. Follow-up to [52768]. Props aliakseyenkaihar, audrasjb, rafiahmedd. Merges [52791] to the 5.9 branch. Fixes #55241. Built from https://develop.svn.wordpress.org/branches/5.9@53009 --- wp-includes/class-wp-theme-json.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index d98a2379ca..34893ffb78 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -1598,6 +1598,7 @@ public function get_svg_filters( $origins ) { $blocks_metadata = static::get_blocks_metadata(); $setting_nodes = static::get_setting_nodes( $this->theme_json, $blocks_metadata ); + $filters = ''; foreach ( $setting_nodes as $metadata ) { $node = _wp_array_get( $this->theme_json, $metadata['path'], array() ); if ( empty( $node['color']['duotone'] ) ) { @@ -1606,7 +1607,6 @@ public function get_svg_filters( $origins ) { $duotone_presets = $node['color']['duotone']; - $filters = ''; foreach ( $origins as $origin ) { if ( ! isset( $duotone_presets[ $origin ] ) ) { continue; diff --git a/wp-includes/version.php b/wp-includes/version.php index a73598dd92..74afd8a78d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9.3-alpha-53008'; +$wp_version = '5.9.3-alpha-53009'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.