WordPress.org

Make WordPress Core

Changeset 40112


Ignore:
Timestamp:
02/24/2017 08:51:19 PM (3 years ago)
Author:
azaozz
Message:

TinyMCE: preserve empty image alt attributes.

Props afercia.
Merges [40110] to the 4.7 branch.
Fixes #39912.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r38796 r40112  
    383383            width: width || null,
    384384            height: height || null,
    385             alt: imageData.alt,
    386385            title: imageData.title || null,
    387386            'class': classes.join( ' ' ) || null
     
    389388
    390389        dom.setAttribs( imageNode, attrs );
     390
     391        // Preserve empty alt attributes.
     392        editor.$( imageNode ).attr( 'alt', imageData.alt || '' );
    391393
    392394        linkAttrs = {
     
    10271029        if ( event.format !== 'raw' ) {
    10281030            editor.$( 'img[id="__wp-temp-img-id"]' ).attr( 'id', null );
    1029         }   
     1031        }
    10301032    });
    10311033
Note: See TracChangeset for help on using the changeset viewer.