mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Code Modernisation: Fix known instances of array access on data types that can't be accessed as arrays.
PHP 7.4 addes a warning when trying access a null/bool/int/float/resource (everything but array, string and object) as if it were an array. This change fixes all of these warnings visible in unit tests. Props jrf. See #47704. git-svn-id: https://develop.svn.wordpress.org/trunk@45639 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user