Unserialize get_metadata() results when 'key' is omitted.

Props mattkeys, nacin.
Fixes #15030.

git-svn-id: https://develop.svn.wordpress.org/trunk@30115 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2014-10-30 10:24:22 +00:00
parent cdc35000f9
commit 9a84da90c3
2 changed files with 43 additions and 1 deletions

View File

@@ -478,8 +478,13 @@ function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) {
$meta_cache = $meta_cache[$object_id];
}
if ( !$meta_key )
if ( ! $meta_key ) {
foreach ( $meta_cache as &$meta_values ) {
$meta_values = array_map( 'maybe_unserialize', $meta_values );
}
return $meta_cache;
}
if ( isset($meta_cache[$meta_key]) ) {
if ( $single )