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

Props mattkeys, nacin.
Fixes #15030.
Built from https://develop.svn.wordpress.org/trunk@30115


git-svn-id: http://core.svn.wordpress.org/trunk@30115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2014-10-30 10:25:22 +00:00
parent 909aa4f1e7
commit 93ae51e801
2 changed files with 7 additions and 2 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 )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-alpha-30114';
$wp_version = '4.1-alpha-30115';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.