Skip to content

Commit 442f9de

Browse files
authored
Merge pull request #213 from cloudinary/hotfix/typecasting
Hotfix typecasting
2 parents f0af113 + 23d30e0 commit 442f9de

File tree

1 file changed

+2
-2
lines changed
  • cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php

1 file changed

+2
-2
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-media.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,7 +1726,7 @@ public function get_upload_options( $attachment_id ) {
17261726
*/
17271727
public function maybe_overwrite_featured_image( $attachment_id ) {
17281728
$overwrite = false;
1729-
if ( $this->doing_featured_image && $this->doing_featured_image === $attachment_id ) {
1729+
if ( $this->doing_featured_image && $this->doing_featured_image === (int) $attachment_id ) {
17301730
$overwrite = (bool) $this->get_post_meta( get_the_ID(), Global_Transformations::META_FEATURED_IMAGE_KEY, true );
17311731
}
17321732

@@ -1740,7 +1740,7 @@ public function maybe_overwrite_featured_image( $attachment_id ) {
17401740
* @param int $attachment_id The thumbnail ID.
17411741
*/
17421742
public function set_doing_featured( $post_id, $attachment_id ) {
1743-
$this->doing_featured_image = $attachment_id;
1743+
$this->doing_featured_image = (int) $attachment_id;
17441744
add_action( 'end_fetch_post_thumbnail_html', function () {
17451745
$this->doing_featured_image = false;
17461746
} );

0 commit comments

Comments
 (0)