WordPress.org

Make WordPress Core

Changeset 46964 for trunk


Ignore:
Timestamp:
12/16/2019 12:53:59 PM (19 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-admin/widgets.php.

Props jenilk.
Fixes #49000.

File:
1 edited

Legend:

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

    r45932 r46964  
    2525    check_admin_referer( 'widgets-access' );
    2626
    27     $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
     27    $widgets_access = 'on' === $_GET['widgets-access'] ? 'on' : 'off';
    2828    set_user_setting( 'widgets_access', $widgets_access );
    2929}
    3030
    31 if ( 'on' == $widgets_access ) {
     31if ( 'on' === $widgets_access ) {
    3232    add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );
    3333} else {
     
    9797
    9898foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
    99     if ( 'wp_inactive_widgets' == $sidebar_id ) {
     99    if ( 'wp_inactive_widgets' === $sidebar_id ) {
    100100        continue;
    101101    }
     
    189189
    190190    foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
    191         if ( $name != $id_base || ! is_callable( $control['callback'] ) ) {
     191        if ( $name !== $id_base || ! is_callable( $control['callback'] ) ) {
    192192            continue;
    193193        }
     
    317317    foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
    318318        echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
    319         if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
     319        if ( 'wp_inactive_widgets' === $sbname || 'orphaned_widgets' === substr( $sbname, 0, 16 ) ) {
    320320            echo '&nbsp;';
    321321        } else {
     
    457457$theme_sidebars = array();
    458458foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
    459     if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) {
     459    if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {
    460460        $wrap_class = 'widgets-holder-wrap';
    461461        if ( ! empty( $registered_sidebar['class'] ) ) {
     
    463463        }
    464464
    465         $is_inactive_widgets = 'wp_inactive_widgets' == $registered_sidebar['id'];
     465        $is_inactive_widgets = 'wp_inactive_widgets' === $registered_sidebar['id'];
    466466        ?>
    467467        <div class="<?php echo esc_attr( $wrap_class ); ?>">
     
    511511
    512512if ( $sidebars_count > 1 ) {
    513     $split = ceil( $sidebars_count / 2 );
     513    $split = (int) ceil( $sidebars_count / 2 );
    514514} else {
    515515    $single_sidebar_class = ' single-sidebar';
     
    532532    }
    533533
    534     if ( $split && $i == $split ) {
     534    if ( $split && $i === $split ) {
    535535        ?>
    536536        </div><div class="sidebars-column-2">
Note: See TracChangeset for help on using the changeset viewer.