Skip to content

Commit d49299e

Browse files
authored
Merge pull request #429 from cloudinary/revert-428-fix/meta-null-from-master
Revert "default meta key as string"
2 parents 55c4b22 + 828cac9 commit d49299e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

php/class-media.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,13 +1824,13 @@ public function get_transformation_from_meta( $post_id ) {
18241824
/**
18251825
* Get Cloudinary related Post meta.
18261826
*
1827-
* @param int $post_id The attachment ID.
1828-
* @param string $key The meta key to get.
1829-
* @param bool $single If single or not.
1827+
* @param int $post_id The attachment ID.
1828+
* @param string|null $key The meta key to get.
1829+
* @param bool $single If single or not.
18301830
*
18311831
* @return mixed
18321832
*/
1833-
public function get_post_meta( $post_id, $key = '', $single = false ) {
1833+
public function get_post_meta( $post_id, $key = null, $single = false ) {
18341834

18351835
$meta_data = wp_get_attachment_metadata( $post_id, true );
18361836
if ( ! is_array( $meta_data ) ) {
@@ -1840,7 +1840,7 @@ public function get_post_meta( $post_id, $key = '', $single = false ) {
18401840
$meta_data[ Sync::META_KEYS['cloudinary'] ] = array();
18411841
}
18421842

1843-
if ( '' === $key ) {
1843+
if ( null === $key ) {
18441844
$data = $meta_data[ Sync::META_KEYS['cloudinary'] ];
18451845
} elseif ( ! empty( $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] ) ) {
18461846
$data = $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ];

0 commit comments

Comments
 (0)