From 256d9849fa8784bda78d7fc8ba27de1ae48bc352 Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Fri, 7 Jun 2019 10:36:00 -0400 Subject: [PATCH] Deprecate get_image_id All images should be stored as integers, not URLs. This is only invoked if an image ID is delivered as a URL instead of an integer, which was fixed back in 2.2.0. --- includes/class-displayfeaturedimagegenesis-common.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/class-displayfeaturedimagegenesis-common.php b/includes/class-displayfeaturedimagegenesis-common.php index cf5512f..0f34028 100644 --- a/includes/class-displayfeaturedimagegenesis-common.php +++ b/includes/class-displayfeaturedimagegenesis-common.php @@ -281,13 +281,15 @@ class Display_Featured_Image_Genesis_Common { */ public static function get_image_id( $attachment_url = '' ) { - $attachment_id = false; - + _deprecated_function( __FUNCTION__, '3.1.0' ); // as of 2.2.0, if a (new) image id is passed to the function, or if it's empty, return it as is. if ( is_numeric( $attachment_url ) || '' === $attachment_url ) { return $attachment_url; } + _deprecated_function( __FUNCTION__, '3.1.0' ); + $attachment_id = false; + // 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 );