Make WordPress Core


Ignore:
Timestamp:
10/19/2009 08:23:35 PM (17 years ago)
Author:
azaozz
Message:

Merge set-post-thumbnail-handler.js with post.js, move Post Thumbnail meta-box to /includes/meta-boxes.php, see #10928

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r12059 r12060  
    113113
    114114        return $html;
    115 }
    116 
    117 function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
    118         $content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a></p>';
    119 
    120         if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
    121                 $thumbnail_html = wp_get_attachment_image($thumbnail_id, array( 266, 266 ) );
    122                 if ( !empty( $thumbnail_html ) ) {
    123                         $content = '<a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>';
    124                         $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove thumbnail' ) . '</a></p>';
    125                 }
    126         }
    127 
    128         return apply_filters( 'admin_post_thumbnail_html', $content );
    129 }
    130 
    131 function post_thumbnail_meta_box() {
    132         global $post;
    133         $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
    134         echo _wp_post_thumbnail_html( $thumbnail_id );
    135115}
    136116
Note: See TracChangeset for help on using the changeset viewer.