Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions php/class-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand All @@ -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 ];
Expand Down