From f89a4f5b21d4978ce7b30acbaf234b9e8b759128 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Fri, 5 Jul 2013 18:45:41 +0000 Subject: [PATCH] Remove img_html_to_post_id(). It's unused since [24555]. fixes #24610. git-svn-id: https://develop.svn.wordpress.org/trunk@24569 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/media.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 206d5394d6..450b8ab875 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2266,33 +2266,3 @@ function get_post_gallery_images( $post_id = 0 ) { return $gallery['src']; } - -/** - * Retrieve the attachment post id from HTML containing an image. - * - * @since 3.6.0 - * - * @param string $html The html, possibly with an image - * @param string $matched_html Passed by reference, will be set to to the matched img string - * @return int The attachment id if found, or 0. - */ -function img_html_to_post_id( $html, &$matched_html = null ) { - $attachment_id = 0; - - // Look for an tag - if ( ! preg_match( '#' . get_tag_regex( 'img' ) . '#i', $html, $matches ) || empty( $matches ) ) - return $attachment_id; - - $matched_html = $matches[0]; - - // Look for the class attribute. - if ( ! preg_match( '#class=([\'"])(.+?)\1#is', $matched_html, $matches ) || empty( $matches ) ) - return $attachment_id; - - $classes = $matches[2]; - if ( ! empty( $classes ) && false !== strpos( $classes, 'wp-image-' ) ) - if ( preg_match( '#wp-image-([0-9]+)#i', $classes, $matches ) ) - $attachment_id = absint( $matches[1] ); - - return $attachment_id; -}