#55234 closed defect (bug) (duplicate)
PHP Notice: Undefined variable filters in WP_Theme_JSON::get_svg_filters()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Themes | Keywords: | has-patch |
| Focuses: | Cc: |
Description
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.
Change History (5)
This ticket was mentioned in PR #2347 on WordPress/wordpress-develop by vladolaru.
4 years ago
#1
- Keywords has-patch added
#2
@
4 years ago
Actually, besides the notice, the logic is also broken since $filters gets reset on each settings node with duotone.
#3
@
4 years ago
- Version trunk deleted
Hi there! thanks for the ticket and patch.
#55241 ticket has a similar solution as your PR and it was already marge in the core.
Let's ping @audrasjb for 2nd review.
#4
@
4 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
vladolaru commented on PR #2347:
4 years ago
#5
Closing this pull request since a similar fix was already merged in core. See: https://core.trac.wordpress.org/ticket/55234#comment:4
Trac ticket: https://core.trac.wordpress.org/ticket/55234#ticket