Make WordPress Core


Ignore:
Timestamp:
04/06/2015 06:24:53 PM (11 years ago)
Author:
helen
Message:

Insert from URL: Make sure the link text is actually used.

Turns out there were more pieces to renaming the field.

props iseulde.
fixes #29476.

File:
1 edited

Legend:

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

    r32007 r32055  
    24852485        wp_send_json_error();
    24862486
    2487     if ( ! $title = trim( wp_unslash( $_POST['title'] ) ) )
    2488         $title = wp_basename( $src );
     2487    if ( ! $link_text = trim( wp_unslash( $_POST['link_text'] ) ) )
     2488        $link_text = wp_basename( $src );
    24892489
    24902490    $post = get_post( isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0 );
     
    24992499        // TinyMCE view for [embed] will parse this
    25002500        $html = '[embed]' . $src . '[/embed]';
    2501     } elseif ( $title ) {
    2502         $html = '<a href="' . esc_url( $src ) . '">' . $title . '</a>';
     2501    } elseif ( $link_text ) {
     2502        $html = '<a href="' . esc_url( $src ) . '">' . $link_text . '</a>';
    25032503    } else {
    25042504        $html = '';
     
    25122512
    25132513    /** This filter is documented in wp-admin/includes/media.php */
    2514     $html = apply_filters( $type . '_send_to_editor_url', $html, $src, $title );
     2514    $html = apply_filters( $type . '_send_to_editor_url', $html, $src, $link_text );
    25152515
    25162516    wp_send_json_success( $html );
Note: See TracChangeset for help on using the changeset viewer.