diff --git a/includes/class-displayfeaturedimagegenesis-common.php b/includes/class-displayfeaturedimagegenesis-common.php index a3aa09a..6f1fa55 100644 --- a/includes/class-displayfeaturedimagegenesis-common.php +++ b/includes/class-displayfeaturedimagegenesis-common.php @@ -275,9 +275,9 @@ class Display_Featured_Image_Genesis_Common { } // if we're running 4.0 or later, we can do this all using a new core function. if ( function_exists( 'attachment_url_to_postid' ) ) { - $url_stripped = preg_replace( '/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url ); - - return attachment_url_to_postid( $url_stripped ); + $url_stripped = preg_replace( '/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url ); + $attachment_id = attachment_url_to_postid( $url_stripped ); + return $attachment_id > 0 ? $attachment_id : false; } // Get the upload directory paths