WordPress.org

Make WordPress Core

Changeset 40670


Ignore:
Timestamp:
05/15/17 18:41:59 (5 months ago)
Author:
westonruter
Message:

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

Props westonruter, timmydcrawford.
See #39993.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/widgets/media-image-widget.js

    r40640 r40670  
    110110 
    111111        /** 
     112         * Get the instance props from the media selection frame. 
     113         * 
     114         * Prevent the image_title attribute from being initially set when adding an image from the media library. 
     115         * 
     116         * @param {wp.media.view.MediaFrame.Select} mediaFrame - Select frame. 
     117         * @returns {Object} Props. 
     118         */ 
     119        getModelPropsFromMediaFrame: function getModelPropsFromMediaFrame( mediaFrame ) { 
     120            var control = this; 
     121            return _.omit( 
     122                component.MediaWidgetControl.prototype.getModelPropsFromMediaFrame.call( control, mediaFrame ), 
     123                'image_title' 
     124            ); 
     125        }, 
     126 
     127        /** 
    112128         * Map model props to preview template props. 
    113129         * 
Note: See TracChangeset for help on using the changeset viewer.