Make WordPress Core

Changeset 47349


Ignore:
Timestamp:
02/23/2020 08:56:44 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Add missing braces to if conditions and use strict comparison in js/_enqueues/wp/media/editor.js.

Props ankitmaru.
Fixes #49317.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/media/editor.js

    r47122 r47349  
    165165
    166166                        props = wp.media.string.props( props, attachment );
    167                         if ( props.link !== 'embed' )
     167                        if ( props.link !== 'embed' ) {
    168168                                return wp.media.string.link( props );
     169                        }
    169170
    170171                        shortcode = {};
    … …  
    447448                                if ( attrs._orderbyRandom ) {
    448449                                        attrs.orderby = 'rand';
    449                                 } else if ( attrs._orderByField && attrs._orderByField != 'rand' ) {
     450                                } else if ( attrs._orderByField && 'rand' !== attrs._orderByField ) {
    450451                                        attrs.orderby = attrs._orderByField;
    451452                                }
    … …  
    626627                                _wpnonce:     settings.post.nonce
    627628                        }).done( function( html ) {
    628                                 if ( html == '0' ) {
     629                                if ( '0' === html ) {
    629630                                        window.alert( window.setPostThumbnailL10n.error );
    630631                                        return;
    … …  
    802803                                selection = selection || state.get('selection');
    803804
    804                                 if ( ! selection )
     805                                if ( ! selection ) {
    805806                                        return;
     807                                }
    806808
    807809                                $.when.apply( $, selection.map( function( attachment ) {
    … …  
    966968                                                alt:   'image_alt'
    967969                                        }, function( option, prop ) {
    968                                                 if ( props[ prop ] )
     970                                                if ( props[ prop ] ) {
    969971                                                        options[ option ] = props[ prop ];
     972                                                }
    970973                                        });
    971974                                } else if ( 'video' === attachment.type ) {
Note: See TracChangeset for help on using the changeset viewer.