WordPress.org

Make WordPress Core

Ticket #23726: 23726.2.diff

File 23726.2.diff, 2.2 KB (added by wonderboymusic, 13 months ago)
  • wp-admin/includes/media.php

    diff --git wp-admin/includes/media.php wp-admin/includes/media.php
    index 500a7ea..375d96b 100644
    function edit_form_image_editor() { 
    22852285        $title = esc_attr( $post->post_title ); 
    22862286        $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); 
    22872287 
    2288         $att_url = wp_get_attachment_url( $post->ID ); 
    2289  
     2288        $att_url = wp_get_attachment_url( $post->ID ); ?> 
     2289        <div class="wp_attachment_holder"> 
     2290        <?php 
    22902291        if ( wp_attachment_is_image( $post->ID ) ) : 
    22912292                $image_edit_button = ''; 
    22922293                if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { 
    function edit_form_image_editor() { 
    22942295                        $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>"; 
    22952296                } 
    22962297        ?> 
    2297         <div class="wp_attachment_holder"> 
     2298 
    22982299                <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div> 
    22992300 
    23002301                <div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image" id="media-head-<?php echo $attachment_id; ?>"> 
    function edit_form_image_editor() { 
    23042305                <div<?php if ( ! $open ) echo ' style="display:none"'; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"> 
    23052306                        <?php if ( $open ) wp_image_editor( $attachment_id ); ?> 
    23062307                </div> 
    2307         </div> 
    2308         <?php endif; ?> 
     2308        <?php 
     2309        elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'audio/' ) ): 
     2310 
     2311                echo do_shortcode( '[audio src="' . $att_url . '"]' ); 
     2312 
     2313        elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'video/' ) ): 
    23092314 
     2315                $meta = wp_get_attachment_metadata( $attachment_id ); 
     2316                $shortcode = sprintf( '[video src="%s"%s%s]', 
     2317                        $att_url, 
     2318                        empty( $meta['width'] ) ? '' : sprintf( ' width="%d"', $meta['width'] ), 
     2319                        empty( $meta['height'] ) ? '' : sprintf( ' height="%d"', $meta['height'] ) 
     2320                ); 
     2321                echo do_shortcode( $shortcode ); 
     2322 
     2323        endif; ?> 
     2324        </div> 
    23102325        <div class="wp_attachment_details edit-form-section"> 
    23112326                <p> 
    23122327                        <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br />