WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/options.php

    r46586 r47808  
    5050        });
    5151
    52         $("input[name='date_format']").click(function(){
    53             if ( "date_format_custom_radio" != $(this).attr("id") )
     52        $( 'input[name="date_format"]' ).click( function() {
     53            if ( 'date_format_custom_radio' !== $(this).attr( 'id' ) )
    5454                $( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    5555        });
     56
    5657        $( 'input[name="date_format_custom"]' ).on( 'click input', function() {
    5758            $( '#date_format_custom_radio' ).prop( 'checked', true );
    5859        });
    5960
    60         $("input[name='time_format']").click(function(){
    61             if ( "time_format_custom_radio" != $(this).attr("id") )
     61        $( 'input[name="time_format"]' ).click( function() {
     62            if ( 'time_format_custom_radio' !== $(this).attr( 'id' ) )
    6263                $( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    6364        });
     
    8182
    8283                    $.post( ajaxurl, {
    83                         action: 'date_format_custom' == format.attr( 'name' ) ? 'date_format' : 'time_format',
     84                        action: 'date_format_custom' === format.attr( 'name' ) ? 'date_format' : 'time_format',
    8485                        date    : format.val()
    8586                    }, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } );
Note: See TracChangeset for help on using the changeset viewer.