Make WordPress Core

Changeset 19256


Ignore:
Timestamp:
11/11/2011 07:38:34 PM (14 years ago)
Author:
ryan
Message:

Don't show 'Use as featured image' in the image insert dialog if the post type does not support thumbnails. Props SergeyBiryukov. fixes #18669

File:
1 edited

Legend:

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

    r19247 r19256  
    11611161    elseif ( isset( $_POST ) && count( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set
    11621162        $calling_post_id = $post->post_parent;
    1163     if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
     1163    if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
     1164        && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
    11641165        $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
    11651166        $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html__( "Use as featured image" ) . "</a>";
Note: See TracChangeset for help on using the changeset viewer.