Index: src/wp-includes/meta.php
===================================================================
--- src/wp-includes/meta.php	(revision 32513)
+++ src/wp-includes/meta.php	(working copy)
@@ -454,7 +454,7 @@
  * 		specified meta_key. This parameter has no effect if meta_key is not specified.
  * @return mixed Single metadata value, or array of values
  */
-function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) {
+function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) {
 	if ( ! $meta_type || ! is_numeric( $object_id ) ) {
 		return false;
 	}
@@ -482,15 +482,16 @@
 	 */
 	$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single );
 	if ( null !== $check ) {
-		if ( $single && is_array( $check ) )
+		if ( $single && is_array( $check ) ) {
 			return $check[0];
-		else
+		} else {
 			return $check;
+		}
 	}
 
-	$meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
+	$meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );
 
-	if ( !$meta_cache ) {
+	if ( ! $meta_cache ) {
 		$meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
 		$meta_cache = $meta_cache[$object_id];
 	}
@@ -499,17 +500,35 @@
 		return $meta_cache;
 	}
 
-	if ( isset($meta_cache[$meta_key]) ) {
-		if ( $single )
-			return maybe_unserialize( $meta_cache[$meta_key][0] );
-		else
-			return array_map('maybe_unserialize', $meta_cache[$meta_key]);
+	if ( isset( $meta_cache[ $meta_key ] ) ) {
+		if ( $single ) {
+			$meta_value = maybe_unserialize( $meta_cache[ $meta_key ][0] );
+		} else {
+			$meta_value = array_map( 'maybe_unserialize', $meta_cache[ $meta_key ] );
+		}
+	} else {
+		if ( $single ) {
+			$meta_value = '';
+		} else {
+			$meta_value = array();
+		}
 	}
-
-	if ($single)
-		return '';
-	else
-		return array();
+	/**
+	 * Filter whether to retrieve metadata of a specific type.
+	 *
+	 * The dynamic portion of the hook, `$meta_type`, refers to the meta
+	 * object type (comment, post, or user) and `$meta_key` refers to Meta key.
+	 * Returning a non-null value will effectively short-circuit the function.
+	 *
+	 * @since 4.3.0
+	 *
+	 * @param null|array|string $value     The value get_metadata() should
+	 *                                     return - a single metadata value,
+	 *                                     or an array of values.
+	 * @param int               $object_id Object ID.
+	 * @param string|array      $single    Meta value, or an array of values.
+	 */
+	return apply_filters( "get_{$meta_type}_metadata-{$meta_key}", $meta_value, $object_id, $single );
 }
 
 /**
