Make WordPress Core


Ignore:
Timestamp:
10/19/2009 08:23:35 PM (15 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/post.php

    r12029 r12060  
    10271027
    10281028    return $return;
     1029}
     1030
     1031/**
     1032 * Output HTML for the post thumbnail meta-box.
     1033 *
     1034 * @since 2.9.0
     1035 *
     1036 * @param int $thumbnail_id ID of the attachment used for thumbnail
     1037 * @return string html
     1038 */
     1039function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
     1040    $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>';
     1041
     1042    if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
     1043        $thumbnail_html = wp_get_attachment_image($thumbnail_id, array( 266, 266 ) );
     1044        if ( !empty( $thumbnail_html ) ) {
     1045            $content = '<a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>';
     1046            $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove thumbnail' ) . '</a></p>';
     1047        }
     1048    }
     1049
     1050    return apply_filters( 'admin_post_thumbnail_html', $content );
    10291051}
    10301052
Note: See TracChangeset for help on using the changeset viewer.