WordPress.org

Make WordPress Core

Changeset 22867


Ignore:
Timestamp:
11/27/12 15:06:02 (17 months ago)
Author:
ryan
Message:

Only show the image edit button for image attachments. Props markoheijnen. fixes #22596

File:
1 edited

Legend:

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

    r22853 r22867  
    11331133 
    11341134    $image_edit_button = ''; 
    1135     if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { 
     1135    if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { 
    11361136        $nonce = wp_create_nonce( "image_editor-$post->ID" ); 
    11371137        $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>"; 
     
    22712271 
    22722272    $image_edit_button = ''; 
    2273     if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { 
     2273    if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { 
    22742274        $nonce = wp_create_nonce( "image_editor-$post->ID" ); 
    22752275        $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>"; 
Note: See TracChangeset for help on using the changeset viewer.