From 0a6fb4973f50c4f0cbf28b1a3184b4b6bc4e7509 Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Tue, 31 Oct 2017 17:22:57 -0400 Subject: [PATCH] Deprecate function to convert image URL to ID We've been storing images by ID since 2.2.0 so I'd like to get rid of this. --- includes/class-displayfeaturedimagegenesis-common.php | 2 ++ includes/helper-functions.php | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/class-displayfeaturedimagegenesis-common.php b/includes/class-displayfeaturedimagegenesis-common.php index ba69136..e3f1999 100644 --- a/includes/class-displayfeaturedimagegenesis-common.php +++ b/includes/class-displayfeaturedimagegenesis-common.php @@ -267,6 +267,8 @@ class Display_Featured_Image_Genesis_Common { */ public static function get_image_id( $attachment_url = '' ) { + _deprecated_function( __FUNCTION__, '2.7.0' ); + $attachment_id = false; // as of 2.2.0, if a (new) image id is passed to the function, or if it's empty, return it as is. diff --git a/includes/helper-functions.php b/includes/helper-functions.php index 25d61dc..d0e0a55 100644 --- a/includes/helper-functions.php +++ b/includes/helper-functions.php @@ -221,13 +221,12 @@ function display_featured_image_genesis_add_archive_thumbnails() { * @since 2.3.0 */ function displayfeaturedimagegenesis_check_image_id( $image_id = '' ) { - $image_id = is_numeric( $image_id ) ? $image_id : Display_Featured_Image_Genesis_Common::get_image_id( $image_id ); - return $image_id; + return is_numeric( $image_id ) || ! $image_id ? $image_id : Display_Featured_Image_Genesis_Common::get_image_id( $image_id ); } /** * Helper function to get the plugin settings. - * @return mixed|void + * @return mixed * * @since 2.4.2 */