WordPress.org

Make WordPress Core

Changeset 22807


Ignore:
Timestamp:
11/22/2012 03:43:16 AM (9 years ago)
Author:
koopersmith
Message:

Media: Replace the thumbnail on post.php using a request variable instead of the referer. props ocean90. fixes #21391.

Location:
trunk/wp-admin
Files:
3 edited

Legend:

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

    r22749 r22807  
    712712        if ( $target == 'thumbnail' || $target == 'all' || $target == 'full' ) {
    713713            // Check if it's an image edit from attachment edit screen
    714             if ( false !== strpos( wp_get_referer(), 'post.php' ) ) {
     714            if ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' == $_REQUEST['context'] ) {
    715715                $thumb_url = wp_get_attachment_image_src( $post_id, array( 900, 600 ), true );
    716716                $return->thumbnail = $thumb_url[0];
  • trunk/wp-admin/includes/media.php

    r22783 r22807  
    22452245    $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
    22462246
    2247     $post_mime_types = get_post_mime_types();
    2248     $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) );
    2249     $type = array_shift( $keys );
    2250     $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
    2251 
    22522247    $media_dims = '';
    22532248    $meta = wp_get_attachment_metadata( $post->ID );
     
    22952290        echo '<input type="hidden" name="' . esc_attr( $hidden_field ) . '" value="' . esc_attr( $value ) . '" />' . "\n";
    22962291    }
     2292    echo '<input type="hidden" id="image-edit-context" value="edit-attachment" />' . "\n";
    22972293}
    22982294
  • trunk/wp-admin/js/image-edit.js

    r22592 r22807  
    246246            'history': history,
    247247            'target': target,
     248            'context': $('#image-edit-context').length ? $('#image-edit-context').val() : null,
    248249            'do': 'save'
    249250        };
Note: See TracChangeset for help on using the changeset viewer.