Make WordPress Core

Changeset 12322


Ignore:
Timestamp:
12/06/2009 05:02:51 PM (15 years ago)
Author:
markjaquith
Message:

Display Post/Page Thumbnail meta box even if theme does not support it -- just display an info message. props janeforshort

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r12132 r12322  
    9999
    100100add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core');
    101 if ( current_theme_supports( 'post-thumbnails' ) )
    102     add_meta_box('postthumbnaildiv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low');
     101add_meta_box('postthumbnaildiv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low');
    103102add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core');
    104103add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core');
  • trunk/wp-admin/edit-page-form.php

    r12132 r12322  
    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-thumbnails' ) )
    84     add_meta_box('postthumbnaildiv', __('Page Thumbnail'), 'post_thumbnail_meta_box', 'page', 'side', 'low');
     83add_meta_box('postthumbnaildiv', __('Page Thumbnail'), 'post_thumbnail_meta_box', 'page', 'side', 'low');
    8584
    8685$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
  • trunk/wp-admin/includes/post.php

    r12298 r12322  
    10691069 */
    10701070function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
     1071    global $post;
     1072    if ( !current_theme_supports( 'post-thumbnails' ) ) {
     1073        if ( 'post' == $post->post_type ) {
     1074            $type = __( 'post' );
     1075        } elseif ( 'page' == $post->post_type ) {
     1076            $type = __( 'page' );
     1077        } else {
     1078            $type = $post->post_type;
     1079        }
     1080        return sprintf( __( '<p>Your theme does not currently support <a href="%1$s">%2$s thumbnails</a>.</p><p>You can hide this module by clicking the "Screen Options" tab.</p>' ), _x( 'http://codex.wordpress.org/Post_Images', 'Within the post/page thumbnail module on the post/page edit screen' ), $type );
     1081    }
    10711082    $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>';
    10721083
Note: See TracChangeset for help on using the changeset viewer.