Ticket #32072: 32072.diff
| File 32072.diff, 1.6 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/includes/ajax-actions.php
2491 2491 } 2492 2492 } 2493 2493 2494 $rel = $url = ''; 2495 $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : ''; 2496 if ( ! empty( $attachment['url'] ) ) { 2497 $url = $attachment['url']; 2498 if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url ) 2499 $rel = ' rel="attachment wp-att-' . $id . '"'; 2500 $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>'; 2494 $rel = ''; 2495 $url = empty( $attachment['url'] ) ? '' : $attachment['url']; 2496 if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url ) { 2497 $rel = ' rel="attachment wp-att-' . $id . '"'; 2501 2498 } 2502 2499 2503 2500 remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' ); … … 2514 2511 } 2515 2512 2516 2513 $title = ''; // We no longer insert title tags into <img> tags, as they are redundant. 2517 $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, (bool)$rel, $size, $alt );2514 $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, $rel, $size, $alt ); 2518 2515 } elseif ( wp_attachment_is( 'video', $post ) || wp_attachment_is( 'audio', $post ) ) { 2519 2516 $html = stripslashes_deep( $_POST['html'] ); 2517 } else { 2518 $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : ''; 2519 if ( ! empty( $url ) ) { 2520 $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>'; 2521 } 2520 2522 } 2521 2523 2522 2524 /** This filter is documented in wp-admin/includes/media.php */