Make WordPress Core


Ignore:
Timestamp:
02/13/2010 11:09:51 AM (15 years ago)
Author:
dd32
Message:

Remove extra get_option() calls (the functions default to that), Use the Media API for attachment image HTML, Replace deprecated function use(1.2~2.9 deprecated). See #9015

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/attachment.php

    r13105 r13109  
    1616                        <span class="meta-sep"> | </span>
    1717                        <span class="meta-prep meta-prep-entry-date"><?php _e('Published ', 'twentyten'); ?></span>
    18                         <span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time( get_option( 'date_format' ) ); ?></abbr></span>
     18                        <span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time(); ?></abbr></span>
    1919                        <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?>
    2020                    </div><!-- .entry-meta -->
     
    2222                    <div class="entry-content">
    2323                        <div class="entry-attachment">
    24 <?php if ( wp_attachment_is_image( $post->ID ) ) : $att_image = wp_get_attachment_image_src( $post->ID,  array(640, 640)); ?>
    25                         <p class="attachment"><a href="<?php echo wp_get_attachment_url($post->ID); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><img src="<?php echo $att_image[0];?>" width="<?php echo $att_image[1];?>" height="<?php echo $att_image[2];?>"  class="attachment-medium" alt="<?php $post->post_excerpt; ?>" /></a>
    26                         </p>
     24<?php if ( wp_attachment_is_image( $post->ID ) ) : ?>
     25                        <p class="attachment"><a href="<?php echo wp_get_attachment_url($post->ID); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
     26                            echo wp_get_attachment_image( $post->ID, array($content_width, $content_width) ); // max $content_width wide or high.
     27                        ?></a></p>
    2728
    2829
     
    3233                </div><!-- #nav-below -->
    3334<?php else : ?>
    34                         <a href="<?php echo wp_get_attachment_url($post->ID) ?>" title="<?php echo esc_attr( get_the_title($post->ID) ); ?>" rel="attachment"><?php echo basename($post->guid) ?></a>
     35                        <a href="<?php echo wp_get_attachment_url($post->ID) ?>" title="<?php echo esc_attr( get_the_title($post->ID) ); ?>" rel="attachment"><?php echo basename(get_permalink()) ?></a>
    3536<?php endif; ?>
    3637                        </div>
Note: See TracChangeset for help on using the changeset viewer.