Changeset 7149 for trunk/wp-includes/post-template.php
- Timestamp:
- 03/04/2008 04:21:37 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r7135 r7149 363 363 // 364 364 365 function the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { 366 echo get_the_attachment_link($id, $fullsize, $max_dims, $permalink); 367 } 368 365 function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) { 366 if ( $fullsize ) 367 echo wp_get_attachment_link($id, 'full', $permalink); 368 else 369 echo wp_get_attachment_link($id, 'thumbnail', $permalink); 370 } 371 372 // get an attachment page link using an image or icon if possible 373 function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false) { 374 $_post = & get_post( intval($id) ); 375 376 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) 377 return __('Missing Attachment'); 378 379 if ( $permalink ) 380 $url = get_attachment_link($_post->ID); 381 382 $post_title = attribute_escape($_post->post_title); 383 384 $link_text = wp_get_attachment_image($attachment_id, $size); 385 if ( !$link_text ) 386 $link_text = $_post->post_title; 387 388 return "<a href='$url' title='$post_title'>$link_text</a>"; 389 390 } 391 392 // deprecated - use wp_get_attachment_link() 369 393 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { 370 394 $id = (int) $id; … … 383 407 } 384 408 409 410 // deprecated: use wp_get_attachment_image_src() 385 411 function get_attachment_icon_src( $id = 0, $fullsize = false ) { 386 412 $id = (int) $id; … … 414 440 } 415 441 442 // deprecated: use wp_get_attachment_image() 416 443 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { 417 444 $id = (int) $id; 418 445 if ( !$post = & get_post($id) ) 419 446 return false; 420 447 421 448 if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) ) 422 449 return false; … … 457 484 } 458 485 486 // deprecated: use wp_get_attachment_image() 459 487 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { 460 488 $id = (int) $id; … … 473 501 function prepend_attachment($content) { 474 502 $p = '<p class="attachment">'; 475 $p .= get_the_attachment_link(false, true, array(400, 300)); 503 // show the medium sized image representation of the attachment if available, and link to the raw file 504 $p .= wp_get_attachment_link(0, 'medium', false); 476 505 $p .= '</p>'; 477 506 $p = apply_filters('prepend_attachment', $p);
Note: See TracChangeset
for help on using the changeset viewer.