Correctly assign post_parent to attachments uploaded in the new media modal. fixes #22085, see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22267 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
be210ffb13
commit
b246624b4f
@ -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
Block a user