WordPress.org

Make WordPress Core

Changeset 12351


Ignore:
Timestamp:
12/10/09 06:14:36 (5 years ago)
Author:
markjaquith
Message:

Post/Page Image was too generic a name. Post/Page Thumbnail is more clear, even if you can create very large thumbnail images if you so choose.

Location:
trunk
Files:
1 added
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r12343 r12351  
    14111411    if ( $thumbnail_id == '-1' ) { 
    14121412        delete_post_meta( $post_id, '_thumbnail_id' ); 
    1413         die( _wp_post_image_html() ); 
     1413        die( _wp_post_thumbnail_html() ); 
    14141414    } 
    14151415 
     
    14181418        if ( !empty( $thumbnail_html ) ) { 
    14191419            update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id ); 
    1420             die( _wp_post_image_html( $thumbnail_id ) ); 
     1420            die( _wp_post_thumbnail_html( $thumbnail_id ) ); 
    14211421        } 
    14221422    } 
  • trunk/wp-admin/edit-form-advanced.php

    r12350 r12351  
    9999 
    100100add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core'); 
    101 if ( current_theme_supports( 'post-images', 'post' ) ) 
    102     add_meta_box('postimagediv', __('Post Image'), 'post_image_meta_box', 'post', 'side', 'low'); 
     101if ( current_theme_supports( 'post-thumbnails', 'post' ) ) 
     102    add_meta_box('postimagediv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low'); 
    103103add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core'); 
    104104add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core'); 
  • trunk/wp-admin/edit-page-form.php

    r12350 r12351  
    8181add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core'); 
    8282add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core'); 
    83 if ( current_theme_supports( 'post-images', 'page' ) ) 
    84     add_meta_box('postimagediv', __('Page Image'), 'post_image_meta_box', 'page', 'side', 'low'); 
     83if ( current_theme_supports( 'post-thumbnails', 'page' ) ) 
     84    add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', 'page', 'side', 'low'); 
    8585 
    8686$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM 
  • trunk/wp-admin/includes/image.php

    r12346 r12351  
    7676 
    7777/** 
    78  * Generate post image attachment meta data. 
     78 * Generate post thumbnail attachment meta data. 
    7979 * 
    8080 * @since 2.1.0 
  • trunk/wp-admin/includes/media.php

    r12350 r12351  
    12401240 
    12411241    $thumbnail = ''; 
    1242     if ( 'image' == $type && isset($_GET['post_id']) && current_theme_supports( 'post-images', get_post_type($_GET['post_id']) ) && get_post_image_id($_GET['post_id']) != $attachment_id ) 
    1243         $thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as post image" ) . "</a>"; 
     1242    if ( 'image' == $type && isset($_GET['post_id']) && current_theme_supports( 'post-thumbnails', get_post_type($_GET['post_id']) ) && get_post_thumbnail_id($_GET['post_id']) != $attachment_id ) 
     1243        $thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>"; 
    12441244 
    12451245    if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) ) 
  • trunk/wp-admin/includes/meta-boxes.php

    r12343 r12351  
    816816 
    817817/** 
    818  * Display post image meta box. 
     818 * Display post thumbnail meta box. 
    819819 * 
    820820 * @since 2.9.0 
    821821 */ 
    822 function post_image_meta_box() { 
     822function post_thumbnail_meta_box() { 
    823823    global $post; 
    824824    $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); 
    825     echo _wp_post_image_html( $thumbnail_id ); 
    826 } 
     825    echo _wp_post_thumbnail_html( $thumbnail_id ); 
     826} 
  • trunk/wp-admin/includes/post.php

    r12343 r12351  
    10631063 
    10641064/** 
    1065  * Output HTML for the post image meta-box. 
     1065 * Output HTML for the post thumbnail meta-box. 
    10661066 * 
    10671067 * @since 2.9.0 
     
    10701070 * @return string html 
    10711071 */ 
    1072 function _wp_post_image_html( $thumbnail_id = NULL ) { 
     1072function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { 
    10731073    global $content_width, $_wp_additional_image_sizes; 
    1074     $content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set image' ) . '</a></p>'; 
     1074    $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>'; 
    10751075 
    10761076    if ( $thumbnail_id && get_post( $thumbnail_id ) ) { 
    10771077        $old_content_width = $content_width; 
    10781078        $content_width = 266; 
    1079         if ( !isset( $_wp_additional_image_sizes['post-image'] ) ) 
     1079        if ( !isset( $_wp_additional_image_sizes['post-thumbnail'] ) ) 
    10801080            $thumbnail_html = wp_get_attachment_image( $thumbnail_id, array( $content_width, $content_width ) ); 
    10811081        else 
    1082             $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-image' ); 
     1082            $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' ); 
    10831083        if ( !empty( $thumbnail_html ) ) { 
    10841084            $content = '<a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>'; 
    1085             $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove image' ) . '</a></p>'; 
     1085            $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove thumbnail' ) . '</a></p>'; 
    10861086        } 
    10871087        $content_width = $old_content_width; 
    10881088    } 
    10891089 
    1090     return apply_filters( 'admin_post_image_html', $content ); 
     1090    return apply_filters( 'admin_post_thumbnail_html', $content ); 
    10911091} 
    10921092 
  • trunk/wp-includes/default-filters.php

    r12302 r12351  
    214214add_action( 'wp_scheduled_delete',        'wp_scheduled_delete' ); 
    215215 
    216 // Post Image CSS class filtering 
    217 add_action( 'begin_fetch_post_image_html', '_wp_post_image_class_filter_add'    ); 
    218 add_action( 'end_fetch_post_image_html',   '_wp_post_image_class_filter_remove' ); 
     216// Post Thumbnail CSS class filtering 
     217add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add'    ); 
     218add_action( 'end_fetch_post_thumbnail_html',   '_wp_post_thumbnail_class_filter_remove' ); 
    219219 
    220220// Redirect Old Slugs 
  • trunk/wp-includes/media.php

    r12342 r12351  
    184184 
    185185/** 
    186  * Registers an image size for the post image 
    187  */ 
    188 function set_post_image_size( $width = 0, $height = 0, $crop = FALSE ) { 
    189     add_image_size( 'post-image', $width, $height, $crop ); 
     186 * Registers an image size for the post thumbnail 
     187 */ 
     188function set_post_thumbnail_size( $width = 0, $height = 0, $crop = FALSE ) { 
     189    add_image_size( 'post-thumbnail', $width, $height, $crop ); 
    190190} 
    191191 
     
    579579 
    580580/** 
    581  * Adds a 'wp-post-image' class to post image thumbnails 
    582  * Uses the begin_fetch_post_image_html and end_fetch_post_image_html action hooks to 
    583  * dynamically add/remove itself so as to only filter post image thumbnails 
     581 * Adds a 'wp-post-image' class to post thumbnail thumbnails 
     582 * Uses the begin_fetch_post_thumbnail_html and end_fetch_post_thumbnail_html action hooks to 
     583 * dynamically add/remove itself so as to only filter post thumbnail thumbnails 
    584584 * 
    585585 * @author Mark Jaquith 
     
    588588 * @return array 
    589589 */ 
    590 function _wp_post_image_class_filter( $attr ) { 
     590function _wp_post_thumbnail_class_filter( $attr ) { 
    591591    $attr['class'] .= ' wp-post-image'; 
    592592    return $attr; 
     
    594594 
    595595/** 
    596  * Adds _wp_post_image_class_filter to the wp_get_attachment_image_attributes filter 
     596 * Adds _wp_post_thumbnail_class_filter to the wp_get_attachment_image_attributes filter 
    597597 * 
    598598 * @author Mark Jaquith 
    599599 * @since 2.9.0 
    600600 */ 
    601 function _wp_post_image_class_filter_add( $attr ) { 
    602     add_filter( 'wp_get_attachment_image_attributes', '_wp_post_image_class_filter' ); 
    603 } 
    604  
    605 /** 
    606  * Removes _wp_post_image_class_filter from the wp_get_attachment_image_attributes filter 
     601function _wp_post_thumbnail_class_filter_add( $attr ) { 
     602    add_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' ); 
     603} 
     604 
     605/** 
     606 * Removes _wp_post_thumbnail_class_filter from the wp_get_attachment_image_attributes filter 
    607607 * 
    608608 * @author Mark Jaquith 
    609609 * @since 2.9.0 
    610610 */ 
    611 function _wp_post_image_class_filter_remove( $attr ) { 
    612     remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_image_class_filter' ); 
     611function _wp_post_thumbnail_class_filter_remove( $attr ) { 
     612    remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' ); 
    613613} 
    614614 
  • trunk/wp-includes/script-loader.php

    r12349 r12351  
    386386        $scripts->add_data( 'set-post-thumbnail', 'group', 1 ); 
    387387        $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( 
    388             'setThumbnail' => __( 'Use as post image' ), 
     388            'setThumbnail' => __( 'Use as thumbnail' ), 
    389389            'saving' => __( 'Saving...' ), 
    390390            'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ) 
  • trunk/wp-includes/theme.php

    r12350 r12351  
    13221322    global $_wp_theme_features; 
    13231323 
    1324     if ( 'post-thumbnails' == $feature ) // This was changed during 2.9 beta. I'll be nice and not break things. 
    1325         $feature = 'post-images'; 
    1326  
    13271324    if ( func_num_args() == 1 ) 
    13281325        $_wp_theme_features[$feature] = true; 
     
    13541351    // @todo Allow pluggable arg checking 
    13551352    switch ( $feature ) { 
    1356         case 'post-images': 
     1353        case 'post-thumbnails': 
    13571354            // post-thumbnails can be registered for only certain content/post types by passing 
    13581355            // an array of types to add_theme_support().  If no array was passed, then 
  • trunk/wp-settings.php

    r12339 r12351  
    693693 
    694694// Load in support for template functions which the theme supports 
    695 require_if_theme_supports( 'post-images', ABSPATH . WPINC . '/post-image-template.php' ); 
     695require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' ); 
    696696 
    697697/** 
Note: See TracChangeset for help on using the changeset viewer.