From 93ae51e801cd8f345b2c05a7e8ba017bd985f787 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 30 Oct 2014 10:25:22 +0000 Subject: [PATCH] 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 --- wp-includes/meta.php | 7 ++++++- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/meta.php b/wp-includes/meta.php index 1091073a54..f7d875f436 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -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 ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 546db820cf..2cf0efd3fc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.