[wp-trac] [WordPress Trac] #55234: PHP Notice: Undefined variable filters in WP_Theme_JSON::get_svg_filters()

WordPress Trac noreply at wordpress.org
Wed Feb 23 07:55:29 UTC 2022


#55234: PHP Notice:  Undefined variable filters in WP_Theme_JSON::get_svg_filters()
--------------------------+-----------------------------
 Reporter:  vlad.olaru    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 If a block theme completely disables the color->duotone support in
 `theme.json`, by setting it to `null`, a PHP notice is generated:

 `Notice: Undefined variable: filters in /app/public/wp-includes/class-wp-
 theme-json.php on line 1620`

 This is due to the fact that the `$filters` variable gets initialized in
 the `foreach` only if a node is found with a non-empty `duotone` entry.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55234>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list