Filters the attachment URL.
Parameters
$url
string- URL for the given attachment.
$attachment_id
int- Attachment post ID.
Source
$url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |
Filters the attachment URL.
$url
string$attachment_id
int$url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );
Version | Description |
---|---|
2.1.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
As of WordPress Version 3.2.1, wp_get_attachment_url() doesn’t distinguish whether a page request arrives via HTTP or HTTPS.
Using wp_get_attachment_url filter, we can fix this to avoid the dreaded mixed content browser warning