Widgets: Prevent image `title` attribute from being populated from attachment `title` by default upon selection.

Props westonruter, timmydcrawford.
See #39993.


git-svn-id: https://develop.svn.wordpress.org/trunk@40670 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2017-05-15 18:41:59 +00:00
parent 41431d153d
commit 6ae69be3a8
1 changed files with 16 additions and 0 deletions

View File

@ -108,6 +108,22 @@
);
},
/**
* Get the instance props from the media selection frame.
*
* Prevent the image_title attribute from being initially set when adding an image from the media library.
*
* @param {wp.media.view.MediaFrame.Select} mediaFrame - Select frame.
* @returns {Object} Props.
*/
getModelPropsFromMediaFrame: function getModelPropsFromMediaFrame( mediaFrame ) {
var control = this;
return _.omit(
component.MediaWidgetControl.prototype.getModelPropsFromMediaFrame.call( control, mediaFrame ),
'image_title'
);
},
/**
* Map model props to preview template props.
*