Codex tools: Log in
Contents |
Returns a full URI for an attachment file or false on failure.
<?php wp_get_attachment_url( $id ); ?>
<?php echo wp_get_attachment_url( 12 ); ?>
outputs something like http://example.net/wp-content/uploads/filename
You can change the output of this function through the wp_get_attachment_url filter.
If you want a URI for the attachment page, not the attachment file itself, you can use get_attachment_link.
Also refer: wp_insert_attachment, wp_upload_dir, wp_get_attachment_image_src
Returns URI to uploaded attachment or "false" on failure.
Since: 2.1.0
wp_get_attachment_url() is located in wp-includes/post.php.
the_attachment_link(), get_attachment_link(), wp_get_attachment_link(), wp_get_attachment_image(), wp_get_attachment_image_src(), wp_get_attachment_url(), wp_get_attachment_thumb_file(), wp_get_attachment_thumb_url(), is_attachment(), wp_get_attachment_metadata()