Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #33878


Ignore:
Timestamp:
09/15/2015 12:52:49 PM (10 years ago)
Author:
swissspidy
Comment:

Note that there's already wp_get_attachment_url() and wp_get_attachment_thumb_url().

My suggestion would be to make those functions a wrapper for wp_get_attachment_image_src() and then add a second $size parameter to wp_get_attachment_url(). Example:

wp_get_attachment_url( $id, $size = 'full' ) { ... wp_get_attachment_image_src() … }
wp_get_attachment_thumb_url( $id ) { return wp_get_attachment_url( $id, 'thumbnail' ); }

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33878

    • Property Version changed from 4.3 to
    • Property Type changed from enhancement to feature request
    • Property Summary changed from Get attachment url to New function: `get_attachment_image_url()`
  • Ticket #33878 – Description

    initial v1  
    1 Function return image attachment url
     1The attached patch adds a new `get_attachment_image_url()` function to retrieve the URL for a given attachment size.