Ticket #22553: 22553.2.diff
| File 22553.2.diff, 2.7 KB (added by nacin, 6 months ago) |
|---|
-
wp-includes/js/media-editor.js
431 431 432 432 if ( 'image' === attachment.type ) { 433 433 html = wp.media.string.image( props ); 434 options ['caption']= caption;434 options.post_excerpt = caption; 435 435 436 436 _.each({ 437 align: ' image-align',437 align: 'align', 438 438 size: 'image-size', 439 alt: 'image -alt'439 alt: 'image_alt' 440 440 }, function( option, prop ) { 441 441 if ( props[ prop ] ) 442 442 options[ option ] = props[ prop ]; … … 444 444 445 445 } else { 446 446 html = wp.media.string.link( props ); 447 options. title = props.title;447 options.post_title = props.title; 448 448 } 449 449 450 450 return media.post( 'send-attachment-to-editor', { -
wp-admin/includes/ajax-actions.php
1936 1936 wp_update_post( array( 'ID' => $id, 'post_parent' => $insert_into_post_id ) ); 1937 1937 } 1938 1938 1939 $html = isset( $attachment['title'] ) ? $attachment['title'] : ''; 1939 $rel = $url = ''; 1940 $html = $title = isset( $attachment['post_title'] ) ? $attachment['post_title'] : ''; 1940 1941 if ( ! empty( $attachment['url'] ) ) { 1941 $ rel = '';1942 if ( strpos( $attachment['url'], 'attachment_id') || get_attachment_link( $id ) == $attachment['url'])1942 $url = $attachment['url']; 1943 if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url ) 1943 1944 $rel = ' rel="attachment wp-att-' . $id . '"'; 1944 $html = '<a href="' . esc_url( $ attachment['url']) . '"' . $rel . '>' . $html . '</a>';1945 $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>'; 1945 1946 } 1946 1947 1947 1948 remove_filter( 'media_send_to_editor', 'image_media_send_to_editor', 10, 3 ); 1948 1949 1949 1950 if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) { 1950 $url = $attachment['url']; 1951 $align = isset( $attachment['image-align'] ) ? $attachment['image-align'] : 'none'; 1951 $align = isset( $attachment['align'] ) ? $attachment['align'] : 'none'; 1952 1952 $size = isset( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium'; 1953 $alt = isset( $attachment['image -alt'] ) ? $attachment['image-alt'] : '';1954 $caption = isset( $attachment[' caption'] ) ? $attachment['caption'] : '';1953 $alt = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : ''; 1954 $caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : ''; 1955 1955 $title = ''; // We no longer insert title tags into <img> tags, as they are redundant. 1956 1956 $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, (bool) $rel, $size, $alt ); 1957 1957 }
