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:
Ryan Boren
2008-02-16 21:54:47 +00:00
parent d84dc7730c
commit c819fc307f
4 changed files with 375 additions and 85 deletions

View File

@@ -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);