Ticket #22085: 22085.diff
| File 22085.diff, 1.2 KB (added by nacin, 6 months ago) |
|---|
-
wp-includes/js/media-editor.js
448 448 return media.post( 'send-attachment-to-editor', { 449 449 nonce: wp.media.view.settings.nonce.sendToEditor, 450 450 attachment: options, 451 html: html 451 html: html, 452 post_id: wp.media.view.settings.postId 452 453 }).done( function( resp ) { 453 454 wp.media.editor.insert( resp ); 454 455 }); -
wp-admin/includes/ajax-actions.php
1931 1931 if ( 'attachment' != $post->post_type ) 1932 1932 wp_send_json_error(); 1933 1933 1934 // If this attachment is unattached, attach it. Primarily a back compat thing. 1935 if ( 0 == $post->post_parent && $insert_into_post_id = intval( $_POST['post_id'] ) ) { 1936 wp_update_post( array( 'ID' => $id, 'post_parent' => $insert_into_post_id ) ); 1937 } 1938 1934 1939 $html = isset( $attachment['title'] ) ? $attachment['title'] : ''; 1935 1940 if ( ! empty( $attachment['url'] ) ) { 1936 1941 $rel = '';
