Skip to content

Commit

Permalink
Themes: Avoid undefined variable warning on get_svg_filters().
Browse files Browse the repository at this point in the history
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


git-svn-id: https://core.svn.wordpress.org/branches/5.9@52598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
audrasjb committed Mar 29, 2022
1 parent 18c8252 commit 1f16dc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) ) {
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1f16dc1

Please sign in to comment.