Changeset 28581 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 05/26/2014 11:56:27 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/ajax-actions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r28580 r28581 2310 2310 */ 2311 2311 function wp_ajax_send_link_to_editor() { 2312 global $post, $wp_embed; 2313 2312 2314 check_ajax_referer( 'media-send-to-editor', 'nonce' ); 2313 2315 … … 2324 2326 $title = wp_basename( $src ); 2325 2327 2326 $html = ''; 2327 if ( $title ) 2328 $post = get_post( isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0 ); 2329 // ping WordPress for an embed 2330 $check_embed = $wp_embed->run_shortcode( '[embed]'. $src .'[/embed]' ); 2331 // fallback that WordPress creates when no oEmbed was found 2332 $fallback = $wp_embed->maybe_make_link( $src ); 2333 2334 if ( $check_embed !== $fallback ) { 2335 // TinyMCE view for [embed] will parse this 2336 $html = '[embed]' . $src . '[/embed]'; 2337 } elseif ( $title ) { 2328 2338 $html = '<a href="' . esc_url( $src ) . '">' . $title . '</a>'; 2339 } else { 2340 $html = ''; 2341 } 2329 2342 2330 2343 // Figure out what filter to run:
Note: See TracChangeset
for help on using the changeset viewer.