Make WordPress Core

Ticket #33878: get_attachment_image_url

File get_attachment_image_url, 922 bytes (added by sebastian.pisula, 10 years ago)
Line 
1Index: wp-includes/media.php
2IDEA additional info:
3Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
4<+>UTF-8
5===================================================================
6--- wp-includes/media.php       (revision 5020135a109b4aff4f52cb4602910af7dfb25e37)
7+++ wp-includes/media.php       (revision )
8@@ -793,6 +793,23 @@
9 }
10 
11 /**
12+ * Get Attachment URL
13+ *
14+ * @param $attachment_id
15+ * @param string $size
16+ * @param bool|false $icon
17+ *
18+ * @return bool|string
19+ */
20+
21+function wp_get_attachment_image_url( $attachment_id, $size = 'post-thumbnail', $icon = false )
22+{
23+    $image = wp_get_attachment_image_src( $attachment_id, $size, $icon );
24+
25+    return isset( $image['0'] ) ? $image['0'] : false;
26+}
27+
28+/**
29  * Adds a 'wp-post-image' class to post thumbnails. Internal use only.
30  *
31  * Uses the 'begin_fetch_post_thumbnail_html' and 'end_fetch_post_thumbnail_html' action hooks to