Opened 7 months ago
Last modified 6 months ago
#22342 new enhancement
WP_DEBUG "undefined index" notices in get_metadata() for empty arrays
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Warnings/Notices | Version: | 3.1 |
| Severity: | minor | Keywords: | has-patch needs-testing dev-feedback 2nd-opinion |
| Cc: |
Description
When the WP_DEBUG constant is set, calling get_metadata() in /wp-includes/meta.php with $single==true can cause "undefined index" notices when the meta data value is an empty array. As null is an acceptable return value for this function, silencing the notice with @ will remove noise when debugging without the overhead of checking the array length or that the 0 index isset().
Attachments (2)
Change History (4)
doublesharp — 7 months ago
comment:1
doublesharp — 7 months ago
- Keywords dev-feedback 2nd-opinion added
comment:2
SergeyBiryukov — 6 months ago
- Version changed from trunk to 3.1
Note: See
TracTickets for help on using
tickets.

silences undefined index notice with @$check[0]