Changeset 32055
- Timestamp:
- 04/06/2015 06:24:53 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r32007 r32055 2485 2485 wp_send_json_error(); 2486 2486 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 ); 2489 2489 2490 2490 $post = get_post( isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0 ); … … 2499 2499 // TinyMCE view for [embed] will parse this 2500 2500 $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>'; 2503 2503 } else { 2504 2504 $html = ''; … … 2512 2512 2513 2513 /** 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 ); 2515 2515 2516 2516 wp_send_json_success( $html ); -
trunk/src/wp-includes/js/media-editor.js
r29802 r32055 881 881 if ( 'link' === type ) { 882 882 _.defaults( embed, { 883 title: embed.url,883 linkText: embed.linkText, 884 884 linkUrl: embed.url 885 885 }); … … 1035 1035 link: function( embed ) { 1036 1036 return wp.media.post( 'send-link-to-editor', { 1037 nonce: wp.media.view.settings.nonce.sendToEditor,1038 src: embed.linkUrl,1039 title: embed.title,1040 html: wp.media.string.link( embed ),1041 post_id: wp.media.view.settings.post.id1037 nonce: wp.media.view.settings.nonce.sendToEditor, 1038 src: embed.linkUrl, 1039 link_text: embed.linkText, 1040 html: wp.media.string.link( embed ), 1041 post_id: wp.media.view.settings.post.id 1042 1042 }); 1043 1043 } -
trunk/src/wp-includes/media-template.php
r31960 r32055 815 815 <label class="setting link-text"> 816 816 <span><?php _e( 'Link Text' ); ?></span> 817 <input type="text" class="alignment" data-setting="link -text" />817 <input type="text" class="alignment" data-setting="linkText" /> 818 818 </label> 819 819 <div class="embed-container" style="display: none;">
Note: See TracChangeset
for help on using the changeset viewer.