From cb916179919facc26e846d493d2287caeb1a340b Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Mon, 15 Jul 2019 01:13:21 +0200
Subject: [PATCH] PHP 7.4/array-access: Fix get_metadata()

---
 src/wp-includes/meta.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php
index 5446c16d3e..9bd989540c 100644
--- a/src/wp-includes/meta.php
+++ b/src/wp-includes/meta.php
@@ -523,7 +523,11 @@ function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false )
 
 	if ( ! $meta_cache ) {
 		$meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
-		$meta_cache = $meta_cache[ $object_id ];
+		if ( isset( $meta_cache[ $object_id ] ) ) {
+			$meta_cache = $meta_cache[ $object_id ];
+		} else {
+			$meta_cache = null;
+		}
 	}
 
 	if ( ! $meta_key ) {
-- 
2.21.0.windows.1

