Make WordPress Core


Ignore:
Timestamp:
11/26/2012 10:08:50 PM (14 years ago)
Author:
ryan
Message:

In wp.media.editor:send, revert back to the old field names used by media_upload_form_handler() for easier back compat.
Fix notices in wp_ajax_send_attachment_to_editor().

Props nacin, azaozz, miqrogroove
fixes #22553

File:
1 edited

Legend:

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

    r22845 r22847  
    19481948        }
    19491949
    1950         $html = isset( $attachment['title'] ) ? $attachment['title'] : '';
     1950        $rel = $url = '';
     1951        $html = $title = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
    19511952        if ( ! empty( $attachment['url'] ) ) {
    1952                 $rel = '';
    1953                 if ( strpos($attachment['url'], 'attachment_id') || get_attachment_link( $id ) == $attachment['url'] )
     1953                $url = $attachment['url'];
     1954                if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url )
    19541955                        $rel = ' rel="attachment wp-att-' . $id . '"';
    1955                 $html = '<a href="' . esc_url( $attachment['url'] ) . '"' . $rel . '>' . $html . '</a>';
     1956                $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
    19561957        }
    19571958
    … …  
    19591960
    19601961        if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {
    1961                 $url = $attachment['url'];
    1962                 $align = isset( $attachment['image-align'] ) ? $attachment['image-align'] : 'none';
     1962                $align = isset( $attachment['align'] ) ? $attachment['align'] : 'none';
    19631963                $size = isset( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';
    1964                 $alt = isset( $attachment['image-alt'] ) ? $attachment['image-alt'] : '';
    1965                 $caption = isset( $attachment['caption'] ) ? $attachment['caption'] : '';
     1964                $alt = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';
     1965                $caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';
    19661966                $title = ''; // We no longer insert title tags into <img> tags, as they are redundant.
    19671967                $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, (bool) $rel, $size, $alt );
Note: See TracChangeset for help on using the changeset viewer.