diff --git a/php/class-media.php b/php/class-media.php index 302b91fa0..2c50b87aa 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1824,13 +1824,13 @@ public function get_transformation_from_meta( $post_id ) { /** * Get Cloudinary related Post meta. * - * @param int $post_id The attachment ID. - * @param string|null $key The meta key to get. - * @param bool $single If single or not. + * @param int $post_id The attachment ID. + * @param string $key The meta key to get. + * @param bool $single If single or not. * * @return mixed */ - public function get_post_meta( $post_id, $key = null, $single = false ) { + public function get_post_meta( $post_id, $key = '', $single = false ) { $meta_data = wp_get_attachment_metadata( $post_id, true ); if ( ! is_array( $meta_data ) ) { @@ -1840,7 +1840,7 @@ public function get_post_meta( $post_id, $key = null, $single = false ) { $meta_data[ Sync::META_KEYS['cloudinary'] ] = array(); } - if ( null === $key ) { + if ( '' === $key ) { $data = $meta_data[ Sync::META_KEYS['cloudinary'] ]; } elseif ( ! empty( $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] ) ) { $data = $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ];