Skip to content

Commit 930b56b

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/branches/5.9@53009 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5963fa5 commit 930b56b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/class-wp-theme-json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,7 @@ public function get_svg_filters( $origins ) {
15981598
$blocks_metadata = static::get_blocks_metadata();
15991599
$setting_nodes = static::get_setting_nodes( $this->theme_json, $blocks_metadata );
16001600

1601+
$filters = '';
16011602
foreach ( $setting_nodes as $metadata ) {
16021603
$node = _wp_array_get( $this->theme_json, $metadata['path'], array() );
16031604
if ( empty( $node['color']['duotone'] ) ) {
@@ -1606,7 +1607,6 @@ public function get_svg_filters( $origins ) {
16061607

16071608
$duotone_presets = $node['color']['duotone'];
16081609

1609-
$filters = '';
16101610
foreach ( $origins as $origin ) {
16111611
if ( ! isset( $duotone_presets[ $origin ] ) ) {
16121612
continue;

0 commit comments

Comments
 (0)