Correctly assign post_parent to attachments uploaded in the new media modal. fixes #22085, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7b62c8753d
commit
4188c373fd
|
@ -672,16 +672,23 @@
|
|||
},
|
||||
|
||||
maybeInitUploader: function() {
|
||||
var workspace = this;
|
||||
var workspace = this,
|
||||
params = {},
|
||||
$id;
|
||||
|
||||
// If the uploader already exists or the body isn't in the DOM, bail.
|
||||
if ( this.uploader || ! this.$el.closest('body').length )
|
||||
return;
|
||||
|
||||
$id = $('#post_ID');
|
||||
if ( $id.length )
|
||||
params.post_id = $id.val();
|
||||
|
||||
this.uploader = new wp.Uploader( _.extend({
|
||||
container: this.$el,
|
||||
dropzone: this.$el,
|
||||
browser: this.$('.upload-attachments a')
|
||||
browser: this.$('.upload-attachments a'),
|
||||
params: params
|
||||
}, this.options.uploader ) );
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue