[wp-trac] [WordPress Trac] #22342: WP_DEBUG "undefined index" notices in get_metadata() for empty arrays
WordPress Trac
noreply at wordpress.org
Thu Nov 1 22:10:42 UTC 2012
#22342: WP_DEBUG "undefined index" notices in get_metadata() for empty arrays
-------------------------------------+------------------------------
Reporter: doublesharp | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Warnings/Notices
Version: trunk | Severity: minor
Keywords: has-patch needs-testing |
-------------------------------------+------------------------------
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().
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22342>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list