Make WordPress Core


Ignore:
Timestamp:
10/20/2005 08:48:32 PM (20 years ago)
Author:
ryan
Message:

Image fu from Andy. fixes #1776

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-functions-post.php

    r2955 r2958  
    439439}
    440440
     441function prepend_object($content) {
     442    global $post;
     443
     444    $p = '<p class="subpostobject">';
     445
     446    if ( '' != $post->guid ) {
     447        if ( substr($post->post_type, 0, 6) == 'image/' )
     448            $p .= '<a href="' . $post->guid . '" title="Click for full-size image" ><img class="subpostimage" src="' . $post->guid . '" alt="' . $post->post_title . '" /></a>';
     449        else
     450            $p .= __('Attachment') . ' (' . $post->post_type . ')';
     451    } else {
     452        $p .= __('Missing attachment');
     453    }
     454
     455    $p .= '</p>';
     456
     457    return "$p\n$content";
     458}
    441459?>
Note: See TracChangeset for help on using the changeset viewer.