mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Media handling updates from andy. fixes #5874
git-svn-id: https://develop.svn.wordpress.org/trunk@6876 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -366,13 +366,16 @@ function the_attachment_link($id = 0, $fullsize = false, $max_dims = false) {
|
||||
echo get_the_attachment_link($id, $fullsize, $max_dims);
|
||||
}
|
||||
|
||||
function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false) {
|
||||
function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {
|
||||
$id = (int) $id;
|
||||
$_post = & get_post($id);
|
||||
|
||||
if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
|
||||
return __('Missing Attachment');
|
||||
|
||||
if ( $permalink )
|
||||
$url = get_attachment_link($_post->ID);
|
||||
|
||||
$post_title = attribute_escape($_post->post_title);
|
||||
|
||||
$innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);
|
||||
|
||||
Reference in New Issue
Block a user