Make WordPress Core

Ticket #54728: 54728.6.diff

File 54728.6.diff, 50.6 KB (added by azouamauriac, 3 years ago)

Fix "WordPress.PHP.StrictComparisons.LooseComparison" in src/wp-admin/

  • src/wp-admin/includes/ajax-actions.php

     
    148148         * Require $term_search_min_chars chars for matching (default: 2)
    149149         * ensure it's a non-negative, non-zero integer.
    150150         */
    151         if ( ( 0 == $term_search_min_chars ) || ( strlen( $s ) < $term_search_min_chars ) ) {
     151        if ( ( 0 === $term_search_min_chars ) || ( strlen( $s ) < $term_search_min_chars ) ) {
    152152                wp_die();
    153153        }
    154154
     
    188188                $force_gzip = ( defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP );
    189189                $test_str   = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."';
    190190
    191                 if ( 1 == $_GET['test'] ) {
     191                if ( 1 === $_GET['test'] ) {
    192192                        echo $test_str;
    193193                        wp_die();
    194                 } elseif ( 2 == $_GET['test'] ) {
     194                } elseif ( 2 === $_GET['test'] ) {
    195195                        if ( ! isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {
    196196                                wp_die( -1 );
    197197                        }
     
    482482        }
    483483
    484484        // Only do the expensive stuff on a page-break, and about 1 other time per page.
    485         if ( 0 == $total % $per_page || 1 == mt_rand( 1, $per_page ) ) {
     485        if ( 0 === $total % $per_page || 1 === mt_rand( 1, $per_page ) ) {
    486486                $post_id = 0;
    487487                // What type of comment count are we looking for?
    488488                $status = 'all';
     
    702702        $status = wp_get_comment_status( $comment );
    703703        $delta  = -1;
    704704
    705         if ( isset( $_POST['trash'] ) && 1 == $_POST['trash'] ) {
     705        if ( isset( $_POST['trash'] ) && 1 === $_POST['trash'] ) {
    706706                if ( 'trash' === $status ) {
    707707                        wp_die( time() );
    708708                }
    709709
    710710                $r = wp_trash_comment( $comment );
    711         } elseif ( isset( $_POST['untrash'] ) && 1 == $_POST['untrash'] ) {
     711        } elseif ( isset( $_POST['untrash'] ) && 1 === $_POST['untrash'] ) {
    712712                if ( 'trash' !== $status ) {
    713713                        wp_die( time() );
    714714                }
     
    719719                if ( ! isset( $_POST['comment_status'] ) || 'trash' !== $_POST['comment_status'] ) {
    720720                        $delta = 1;
    721721                }
    722         } elseif ( isset( $_POST['spam'] ) && 1 == $_POST['spam'] ) {
     722        } elseif ( isset( $_POST['spam'] ) && 1 === $_POST['spam'] ) {
    723723                if ( 'spam' === $status ) {
    724724                        wp_die( time() );
    725725                }
    726726
    727727                $r = wp_spam_comment( $comment );
    728         } elseif ( isset( $_POST['unspam'] ) && 1 == $_POST['unspam'] ) {
     728        } elseif ( isset( $_POST['unspam'] ) && 1 === $_POST['unspam'] ) {
    729729                if ( 'spam' !== $status ) {
    730730                        wp_die( time() );
    731731                }
     
    736736                if ( ! isset( $_POST['comment_status'] ) || 'spam' !== $_POST['comment_status'] ) {
    737737                        $delta = 1;
    738738                }
    739         } elseif ( isset( $_POST['delete'] ) && 1 == $_POST['delete'] ) {
     739        } elseif ( isset( $_POST['delete'] ) && 1 === $_POST['delete'] ) {
    740740                $r = wp_delete_comment( $comment );
    741741        } else {
    742742                wp_die( -1 );
     
    969969
    970970        $current = wp_get_comment_status( $comment );
    971971
    972         if ( isset( $_POST['new'] ) && $_POST['new'] == $current ) {
     972        if ( isset( $_POST['new'] ) && $_POST['new'] === $current ) {
    973973                wp_die( time() );
    974974        }
    975975
     
    12991299                                $_POST['_wp_unfiltered_html_comment'] = '';
    13001300                        }
    13011301
    1302                         if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
     1302                        if ( wp_create_nonce( 'unfiltered-html-comment' ) !== $_POST['_wp_unfiltered_html_comment'] ) {
    13031303                                kses_remove_filters(); // Start with a clean slate.
    13041304                                kses_init_filters();   // Set up the filters.
    13051305                                remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
     
    13271327        if ( ! empty( $_POST['approve_parent'] ) ) {
    13281328                $parent = get_comment( $comment_parent );
    13291329
    1330                 if ( $parent && '0' === $parent->comment_approved && $parent->comment_post_ID == $comment_post_ID ) {
     1330                if ( $parent && '0' === $parent->comment_approved && $parent->comment_post_ID === $comment_post_ID ) {
    13311331                        if ( ! current_user_can( 'edit_comment', $parent->comment_ID ) ) {
    13321332                                wp_die( -1 );
    13331333                        }
     
    14261426        }
    14271427
    14281428        $position      = ( isset( $_POST['position'] ) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';
    1429         $checkbox      = ( isset( $_POST['checkbox'] ) && true == $_POST['checkbox'] ) ? 1 : 0;
     1429        $checkbox      = ( isset( $_POST['checkbox'] ) && true === $_POST['checkbox'] ) ? 1 : 0;
    14301430        $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
    14311431
    14321432        $comment = get_comment( $comment_id );
     
    16351635                        wp_die( -1 );
    16361636                }
    16371637
    1638                 if ( $meta->meta_value != $value || $meta->meta_key != $key ) {
     1638                if ( $meta->meta_value !== $value || $meta->meta_key !== $key ) {
    16391639                        $u = update_metadata_by_mid( 'post', $mid, $value, $key );
    16401640                        if ( ! $u ) {
    16411641                                wp_die( 0 ); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
     
    17331733
    17341734        $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
    17351735
    1736         if ( sanitize_key( $page ) != $page ) {
     1736        if ( sanitize_key( $page ) !== $page ) {
    17371737                wp_die( 0 );
    17381738        }
    17391739
     
    17641764        check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
    17651765        $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
    17661766
    1767         if ( sanitize_key( $page ) != $page ) {
     1767        if ( sanitize_key( $page ) !== $page ) {
    17681768                wp_die( 0 );
    17691769        }
    17701770
     
    19191919
    19201920        $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
    19211921
    1922         if ( sanitize_key( $page ) != $page ) {
     1922        if ( sanitize_key( $page ) !== $page ) {
    19231923                wp_die( 0 );
    19241924        }
    19251925
     
    23472347
    23482348        foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
    23492349
    2350                 if ( $name == $id_base ) {
     2350                if ( $name === $id_base ) {
    23512351                        if ( ! is_callable( $control['callback'] ) ) {
    23522352                                continue;
    23532353                        }
     
    26732673                check_ajax_referer( "set_post_thumbnail-$post_ID" );
    26742674        }
    26752675
    2676         if ( '-1' == $thumbnail_id ) {
     2676        if ( '-1' === $thumbnail_id ) {
    26772677                if ( delete_post_thumbnail( $post_ID ) ) {
    26782678                        $return = _wp_post_thumbnail_html( null, $post_ID );
    26792679                        $json ? wp_send_json_success( $return ) : wp_die( $return );
     
    28532853
    28542854        $active_lock = array_map( 'absint', explode( ':', $_POST['active_post_lock'] ) );
    28552855
    2856         if ( get_current_user_id() != $active_lock[1] ) {
     2856        if ( get_current_user_id() !== $active_lock[1] ) {
    28572857                wp_die( 0 );
    28582858        }
    28592859
     
    28782878function wp_ajax_dismiss_wp_pointer() {
    28792879        $pointer = $_POST['pointer'];
    28802880
    2881         if ( sanitize_key( $pointer ) != $pointer ) {
     2881        if ( sanitize_key( $pointer ) !== $pointer ) {
    28822882                wp_die( 0 );
    28832883        }
    28842884
     
    32493249                // If this attachment is unattached, attach it. Primarily a back compat thing.
    32503250                $insert_into_post_id = (int) $_POST['post_id'];
    32513251
    3252                 if ( 0 == $post->post_parent && $insert_into_post_id ) {
     3252                if ( 0 === $post->post_parent && $insert_into_post_id ) {
    32533253                        wp_update_post(
    32543254                                array(
    32553255                                        'ID'          => $id,
     
    32603260        }
    32613261
    32623262        $url = empty( $attachment['url'] ) ? '' : $attachment['url'];
    3263         $rel = ( strpos( $url, 'attachment_id' ) || get_attachment_link( $id ) == $url );
     3263        $rel = ( strpos( $url, 'attachment_id' ) || get_attachment_link( $id ) === $url );
    32643264
    32653265        remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' );
    32663266
     
    39293929                        $wp_site_icon = new WP_Site_Icon();
    39303930
    39313931                        // Skip creating a new attachment if the attachment is a Site Icon.
    3932                         if ( get_post_meta( $attachment_id, '_wp_attachment_context', true ) == $context ) {
     3932                        if ( get_post_meta( $attachment_id, '_wp_attachment_context', true ) === $context ) {
    39333933
    39343934                                // Delete the temporary cropped file, we don't need it.
    39353935                                wp_delete_file( $cropped );
  • src/wp-admin/includes/class-wp-importer.php

     
    4040                                        $hashtable[ $r->meta_value ] = (int) $r->post_id;
    4141                                }
    4242                        }
    43                 } while ( count( $results ) == $limit );
     43                } while ( count( $results ) === $limit );
    4444
    4545                return $hashtable;
    4646        }
     
    104104                                        $source_comment_id = (int) $source_comment_id;
    105105
    106106                                        // Check if this comment came from this blog.
    107                                         if ( $blog_id == $comment_agent_blog_id ) {
     107                                        if ( $blog_id === $comment_agent_blog_id ) {
    108108                                                $hashtable[ $source_comment_id ] = (int) $r->comment_ID;
    109109                                        }
    110110                                }
    111111                        }
    112                 } while ( count( $results ) == $limit );
     112                } while ( count( $results ) === $limit );
    113113
    114114                return $hashtable;
    115115        }
  • src/wp-admin/includes/class-wp-list-table.php

     
    526526                        return false;
    527527                }
    528528
    529                 if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
     529                if ( isset( $_REQUEST['action'] ) && -1 !== $_REQUEST['action'] ) {
    530530                        return $_REQUEST['action'];
    531531                }
    532532
     
    643643
    644644                $month_count = count( $months );
    645645
    646                 if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
     646                if ( ! $month_count || ( 1 === $month_count && 0 === $months[0]->month ) ) {
    647647                        return;
    648648                }
    649649
     
    654654                        <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
    655655                <?php
    656656                foreach ( $months as $arc_row ) {
    657                         if ( 0 == $arc_row->year ) {
     657                        if ( 0 === $arc_row->year ) {
    658658                                continue;
    659659                        }
    660660
     
    906906                $disable_prev  = false;
    907907                $disable_next  = false;
    908908
    909                 if ( 1 == $current ) {
     909                if ( 1 === $current ) {
    910910                        $disable_first = true;
    911911                        $disable_prev  = true;
    912912                }
    913                 if ( $total_pages == $current ) {
     913                if ( $total_pages === $current ) {
    914914                        $disable_last = true;
    915915                        $disable_next = true;
    916916                }
  • src/wp-admin/includes/class-wp-ms-sites-list-table.php

     
    591591                        reset( $this->status_list );
    592592
    593593                        foreach ( $this->status_list as $status => $col ) {
    594                                 if ( 1 == $blog[ $status ] ) {
     594                                if ( 1 === $blog[ $status ] ) {
    595595                                        $class = " class='{$col[0]}'";
    596596                                }
    597597                        }
     
    706706
    707707                $actions['edit']    = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a>';
    708708                $actions['backend'] = "<a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a>';
    709                 if ( get_network()->site_id != $blog['blog_id'] ) {
    710                         if ( '1' == $blog['deleted'] ) {
     709                if ( get_network()->site_id !== $blog['blog_id'] ) {
     710                        if ( '1' === $blog['deleted'] ) {
    711711                                $actions['activate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a>';
    712712                        } else {
    713713                                $actions['deactivate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
    714714                        }
    715715
    716                         if ( '1' == $blog['archived'] ) {
     716                        if ( '1' === $blog['archived'] ) {
    717717                                $actions['unarchive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a>';
    718718                        } else {
    719719                                $actions['archive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a>';
    720720                        }
    721721
    722                         if ( '1' == $blog['spam'] ) {
     722                        if ( '1' === $blog['spam'] ) {
    723723                                $actions['unspam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a>';
    724724                        } else {
    725725                                $actions['spam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Spam', 'site' ) . '</a>';
  • src/wp-admin/includes/class-wp-privacy-policy-content.php

     
    104104
    105105                // The == operator (equal, not identical) was used intentionally.
    106106                // See http://php.net/manual/en/language.operators.array.php
    107                 if ( $new != $old ) {
     107                if ( $new !== $old ) {
    108108                        // A plugin was activated or deactivated, or some policy text has changed.
    109109                        // Show a notice on the relevant screens to inform the admin.
    110110                        add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) );
  • src/wp-admin/includes/class-wp-site-icon.php

     
    202202        public function delete_attachment_data( $post_id ) {
    203203                $site_icon_id = get_option( 'site_icon' );
    204204
    205                 if ( $site_icon_id && $post_id == $site_icon_id ) {
     205                if ( $site_icon_id && $post_id === $site_icon_id ) {
    206206                        delete_option( 'site_icon' );
    207207                }
    208208        }
     
    223223                if ( $single && '_wp_attachment_backup_sizes' === $meta_key ) {
    224224                        $site_icon_id = get_option( 'site_icon' );
    225225
    226                         if ( $post_id == $site_icon_id ) {
     226                        if ( $post_id === $site_icon_id ) {
    227227                                add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) );
    228228                        }
    229229                }
  • src/wp-admin/includes/image-edit.php

     
    554554                $filtered = array( $changes[0] );
    555555                for ( $i = 0, $j = 1, $c = count( $changes ); $j < $c; $j++ ) {
    556556                        $combined = false;
    557                         if ( $filtered[ $i ]->type == $changes[ $j ]->type ) {
     557                        if ( $filtered[ $i ]->type === $changes[ $j ]->type ) {
    558558                                switch ( $filtered[ $i ]->type ) {
    559559                                        case 'rotate':
    560560                                                $filtered[ $i ]->angle += $changes[ $j ]->angle;
     
    603603        foreach ( $changes as $operation ) {
    604604                switch ( $operation->type ) {
    605605                        case 'rotate':
    606                                 if ( 0 != $operation->angle ) {
     606                                if ( 0 !== $operation->angle ) {
    607607                                        if ( $image instanceof WP_Image_Editor ) {
    608608                                                $image->rotate( $operation->angle );
    609609                                        } else {
     
    612612                                }
    613613                                break;
    614614                        case 'flip':
    615                                 if ( 0 != $operation->axis ) {
     615                                if ( 0 !== $operation->axis ) {
    616616                                        if ( $image instanceof WP_Image_Editor ) {
    617                                                 $image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );
     617                                                $image->flip( ( $operation->axis & 1 ) !== 0, ( $operation->axis & 2 ) !== 0 );
    618618                                        } else {
    619                                                 $image = _flip_image_resource( $image, ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );
     619                                                $image = _flip_image_resource( $image, ( $operation->axis & 1 ) !== 0, ( $operation->axis & 2 ) !== 0 );
    620620                                        }
    621621                                }
    622622                                break;
     
    711711        if ( isset( $backup_sizes['full-orig'] ) && is_array( $backup_sizes['full-orig'] ) ) {
    712712                $data = $backup_sizes['full-orig'];
    713713
    714                 if ( $parts['basename'] != $data['file'] ) {
     714                if ( $parts['basename'] !== $data['file'] ) {
    715715                        if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) {
    716716
    717717                                // Delete only if it's an edited image.
     
    738738        foreach ( $default_sizes as $default_size ) {
    739739                if ( isset( $backup_sizes[ "$default_size-orig" ] ) ) {
    740740                        $data = $backup_sizes[ "$default_size-orig" ];
    741                         if ( isset( $meta['sizes'][ $default_size ] ) && $meta['sizes'][ $default_size ]['file'] != $data['file'] ) {
     741                        if ( isset( $meta['sizes'][ $default_size ] ) && $meta['sizes'][ $default_size ]['file'] !== $data['file'] ) {
    742742                                if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) {
    743743
    744744                                        // Delete only if it's an edited image.
     
    853853        $suffix   = time() . rand( 100, 999 );
    854854
    855855        if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE &&
    856                 isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] != $basename ) {
     856                isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] !== $basename ) {
    857857
    858858                if ( 'thumbnail' === $target ) {
    859859                        $new_path = "{$dirname}/{$filename}-temp.{$ext}";
     
    943943                        $tag = false;
    944944                        if ( isset( $meta['sizes'][ $size ] ) ) {
    945945                                if ( isset( $backup_sizes[ "$size-orig" ] ) ) {
    946                                         if ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes[ "$size-orig" ]['file'] != $meta['sizes'][ $size ]['file'] ) {
     946                                        if ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes[ "$size-orig" ]['file'] !== $meta['sizes'][ $size ]['file'] ) {
    947947                                                $tag = "$size-$suffix";
    948948                                        }
    949949                                } else {
  • src/wp-admin/includes/media.php

     
    9393                foreach ( $tabs as $callback => $text ) {
    9494                        $class = '';
    9595
    96                         if ( $current == $callback ) {
     96                        if ( $current === $callback ) {
    9797                                $class = " class='current'";
    9898                        }
    9999
     
    750750                                $post['menu_order'] = $attachment['menu_order'];
    751751                        }
    752752
    753                         if ( isset( $send_id ) && $attachment_id == $send_id ) {
     753                        if ( isset( $send_id ) && $attachment_id === $send_id ) {
    754754                                if ( isset( $attachment['post_parent'] ) ) {
    755755                                        $post['post_parent'] = $attachment['post_parent'];
    756756                                }
     
    784784                                unset( $post['errors'] );
    785785                        }
    786786
    787                         if ( $post != $_post ) {
     787                        if ( $post !== $_post ) {
    788788                                wp_update_post( $post );
    789789                        }
    790790
     
    814814                if ( ! empty( $attachment['url'] ) ) {
    815815                        $rel = '';
    816816
    817                         if ( strpos( $attachment['url'], 'attachment_id' ) || get_attachment_link( $send_id ) == $attachment['url'] ) {
     817                        if ( strpos( $attachment['url'], 'attachment_id' ) || get_attachment_link( $send_id ) === $attachment['url'] ) {
    818818                                $rel = " rel='attachment wp-att-" . esc_attr( $send_id ) . "'";
    819819                        }
    820820
     
    11461146        foreach ( $alignments as $name => $label ) {
    11471147                $name  = esc_attr( $name );
    11481148                $out[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'" .
    1149                         ( $checked == $name ? " checked='checked'" : '' ) .
     1149                        ( $checked === $name ? " checked='checked'" : '' ) .
    11501150                        " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>";
    11511151        }
    11521152
     
    11961196                $css_id  = "image-size-{$size}-{$post->ID}";
    11971197
    11981198                // If this size is the default but that's not available, don't select it.
    1199                 if ( $size == $check ) {
     1199                if ( $size === $check ) {
    12001200                        if ( $enabled ) {
    12011201                                $checked = " checked='checked'";
    12021202                        } else {
     
    13361336 */
    13371337function image_attachment_fields_to_save( $post, $attachment ) {
    13381338        if ( 'image' === substr( $post['post_mime_type'], 0, 5 ) ) {
    1339                 if ( strlen( trim( $post['post_title'] ) ) == 0 ) {
     1339                if ( strlen( trim( $post['post_title'] ) ) === 0 ) {
    13401340                        $attachment_url                           = ( isset( $post['attachment_url'] ) ) ? $post['attachment_url'] : $post['guid'];
    13411341                        $post['post_title']                       = preg_replace( '/\.\w+$/', '', wp_basename( $attachment_url ) );
    13421342                        $post['errors']['post_title']['errors'][] = __( 'Empty Title filled from filename.' );
     
    17611761        if ( 'image' === $type && $calling_post_id
    17621762                && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
    17631763                && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' )
    1764                 && get_post_thumbnail_id( $calling_post_id ) != $attachment_id
     1764                && get_post_thumbnail_id( $calling_post_id ) !== $attachment_id
    17651765        ) {
    17661766
    17671767                $calling_post             = get_post( $calling_post_id );
     
    28402840                $month_count    = count( $arc_result );
    28412841                $selected_month = isset( $_GET['m'] ) ? $_GET['m'] : 0;
    28422842
    2843                 if ( $month_count && ! ( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {
     2843                if ( $month_count && ! ( 1 === $month_count && 0 === $arc_result[0]->mmonth ) ) {
    28442844                        ?>
    28452845                        <select name='m'>
    28462846                        <option<?php selected( $selected_month, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option>
     
    28472847                        <?php
    28482848
    28492849                        foreach ( $arc_result as $arc_row ) {
    2850                                 if ( 0 == $arc_row->yyear ) {
     2850                                if ( 0 === $arc_row->yyear ) {
    28512851                                        continue;
    28522852                                }
    28532853
    28542854                                $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
    28552855
    2856                                 if ( $arc_row->yyear . $arc_row->mmonth == $selected_month ) {
     2856                                if ( $arc_row->yyear . $arc_row->mmonth === $selected_month ) {
    28572857                                        $default = ' selected="selected"';
    28582858                                } else {
    28592859                                        $default = '';
  • src/wp-admin/includes/menu.php

     
    106106         * If the first submenu is not the same as the assigned parent,
    107107         * make the first submenu the new parent.
    108108         */
    109         if ( $new_parent != $old_parent ) {
     109        if ( $new_parent !== $old_parent ) {
    110110                $_wp_real_parent_file[ $old_parent ] = $new_parent;
    111111                $menu[ $id ][2]                      = $new_parent;
    112112
     
    171171        if ( ! empty( $submenu[ $data[2] ] ) && 1 === count( $submenu[ $data[2] ] ) ) {
    172172                $subs      = $submenu[ $data[2] ];
    173173                $first_sub = reset( $subs );
    174                 if ( $data[2] == $first_sub[2] ) {
     174                if ( $data[2] === $first_sub[2] ) {
    175175                        unset( $submenu[ $data[2] ] );
    176176                }
    177177        }
     
    208208        foreach ( $menu as $order => $top ) {
    209209                $i++;
    210210
    211                 if ( 0 == $order ) { // Dashboard is always shown/single.
     211                if ( 0 === $order ) { // Dashboard is always shown/single.
    212212                        $menu[0][4] = add_cssclass( 'menu-top-first', $top[4] );
    213213                        $lastorder  = 0;
    214214                        continue;
     
    227227                        $first             = false;
    228228                }
    229229
    230                 if ( $mc == $i ) { // Last item.
     230                if ( $mc === $i ) { // Last item.
    231231                        $c                 = $menu[ $order ][4];
    232232                        $menu[ $order ][4] = add_cssclass( 'menu-top-last', $c );
    233233                }
     
    297297                } elseif ( ! isset( $menu_order[ $a ] ) && isset( $menu_order[ $b ] ) ) {
    298298                        return 1;
    299299                } elseif ( isset( $menu_order[ $a ] ) && isset( $menu_order[ $b ] ) ) {
    300                         if ( $menu_order[ $a ] == $menu_order[ $b ] ) {
     300                        if ( $menu_order[ $a ] === $menu_order[ $b ] ) {
    301301                                return 0;
    302302                        }
    303303                        return ( $menu_order[ $a ] < $menu_order[ $b ] ) ? -1 : 1;
  • src/wp-admin/includes/meta-boxes.php

     
    973973                endif; // End empty pages check.
    974974        endif;  // End hierarchical check.
    975975
    976         if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) :
     976        if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) !== $post->ID ) :
    977977                $template = ! empty( $post->page_template ) ? $post->page_template : false;
    978978                ?>
    979979<p class="post-attributes-label-wrapper page-template-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label>
     
    13661366                <?php
    13671367                for ( $rating = 0; $rating <= 10; $rating++ ) {
    13681368                        echo '<option value="' . $rating . '"';
    1369                         if ( isset( $link->link_rating ) && $link->link_rating == $rating ) {
     1369                        if ( isset( $link->link_rating ) && $link->link_rating === $rating ) {
    13701370                                echo ' selected="selected"';
    13711371                        }
    13721372                        echo '>' . $rating . '</option>';
  • src/wp-admin/includes/nav-menu.php

     
    926926        $menu_id     = (int) $menu_id;
    927927        $items_saved = array();
    928928
    929         if ( 0 == $menu_id || is_nav_menu( $menu_id ) ) {
     929        if ( 0 === $menu_id || is_nav_menu( $menu_id ) ) {
    930930
    931931                // Loop through all the menu items' POST values.
    932932                foreach ( (array) $menu_data as $_possible_db_id => $_item_object_data ) {
     
    952952                        if (
    953953                                empty( $_item_object_data['menu-item-db-id'] ) ||
    954954                                ( 0 > $_possible_db_id ) ||
    955                                 $_possible_db_id != $_item_object_data['menu-item-db-id']
     955                                $_possible_db_id !== $_item_object_data['menu-item-db-id']
    956956                        ) {
    957957                                $_actual_db_id = 0;
    958958                        } else {
     
    11991199                                $args[ $field ] = isset( $_POST[ $field ][ $_key ] ) ? $_POST[ $field ][ $_key ] : '';
    12001200                        }
    12011201
    1202                         $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][ $_key ] != $_key ? 0 : $_key ), $args );
     1202                        $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][ $_key ] !== $_key ? 0 : $_key ), $args );
    12031203
    12041204                        if ( is_wp_error( $menu_item_db_id ) ) {
    12051205                                $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
     
    12891289
    12901290                        // Build the new array value from leaf to trunk.
    12911291                        for ( $i = count( $array_bits ) - 1; $i >= 0; $i-- ) {
    1292                                 if ( count( $array_bits ) - 1 == $i ) {
     1292                                if ( count( $array_bits ) - 1 === $i ) {
    12931293                                        $new_post_data[ $array_bits[ $i ] ] = wp_slash( $post_input_data->value );
    12941294                                } else {
    12951295                                        $new_post_data = array( $array_bits[ $i ] => $new_post_data );
  • src/wp-admin/includes/post.php

     
    7272                }
    7373        }
    7474
    75         if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )
     75        if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] !== $post_data['user_ID'] )
    7676                && ! current_user_can( $ptype->cap->edit_others_posts ) ) {
    7777
    7878                if ( $update ) {
     
    163163        }
    164164
    165165        foreach ( array( 'aa', 'mm', 'jj', 'hh', 'mn' ) as $timeunit ) {
    166                 if ( ! empty( $post_data[ 'hidden_' . $timeunit ] ) && $post_data[ 'hidden_' . $timeunit ] != $post_data[ $timeunit ] ) {
     166                if ( ! empty( $post_data[ 'hidden_' . $timeunit ] ) && $post_data[ 'hidden_' . $timeunit ] !== $post_data[ $timeunit ] ) {
    167167                        $post_data['edit_date'] = '1';
    168168                        break;
    169169                }
     
    360360                        if ( ! $meta ) {
    361361                                continue;
    362362                        }
    363                         if ( $meta->post_id != $post_ID ) {
     363                        if ( $meta->post_id !== $post_ID ) {
    364364                                continue;
    365365                        }
    366366                        if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $meta->meta_key ) ) {
     
    379379                        if ( ! $meta ) {
    380380                                continue;
    381381                        }
    382                         if ( $meta->post_id != $post_ID ) {
     382                        if ( $meta->post_id !== $post_ID ) {
    383383                                continue;
    384384                        }
    385385                        if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $post_ID, $meta->meta_key ) ) {
     
    489489                }
    490490        }
    491491
    492         if ( -1 == $post_data['_status'] ) {
     492        if ( -1 === $post_data['_status'] ) {
    493493                $post_data['post_status'] = null;
    494494                unset( $post_data['post_status'] );
    495495        } else {
     
    523523        );
    524524
    525525        foreach ( $reset as $field ) {
    526                 if ( isset( $post_data[ $field ] ) && ( '' === $post_data[ $field ] || -1 == $post_data[ $field ] ) ) {
     526                if ( isset( $post_data[ $field ] ) && ( '' === $post_data[ $field ] || -1 === $post_data[ $field ] ) ) {
    527527                        unset( $post_data[ $field ] );
    528528                }
    529529        }
     
    11061106                $url_id = (int) $url_match[2];
    11071107                $rel_id = (int) $rel_match[1];
    11081108
    1109                 if ( ! $url_id || ! $rel_id || $url_id != $rel_id || strpos( $url_match[0], $site_url ) === false ) {
     1109                if ( ! $url_id || ! $rel_id || $url_id !== $rel_id || strpos( $url_match[0], $site_url ) === false ) {
    11101110                        continue;
    11111111                }
    11121112
     
    13371337 * @return string Space-separated string of class names.
    13381338 */
    13391339function postbox_classes( $box_id, $screen_id ) {
    1340         if ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) {
     1340        if ( isset( $_GET['edit'] ) && $_GET['edit'] === $box_id ) {
    13411341                $classes = array( '' );
    13421342        } elseif ( get_user_option( 'closedpostboxes_' . $screen_id ) ) {
    13431343                $closed = get_user_option( 'closedpostboxes_' . $screen_id );
     
    15041504
    15051505                // Encourage a pretty permalink setting.
    15061506                if ( ! get_option( 'permalink_structure' ) && current_user_can( 'manage_options' )
    1507                         && ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $id )
     1507                        && ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) === $id )
    15081508                ) {
    15091509                        $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __( 'Change Permalinks' ) . "</a></span>\n";
    15101510                }
     
    16471647        /** This filter is documented in wp-admin/includes/ajax-actions.php */
    16481648        $time_window = apply_filters( 'wp_check_post_lock_window', 150 );
    16491649
    1650         if ( $time && $time > time() - $time_window && get_current_user_id() != $user ) {
     1650        if ( $time && $time > time() - $time_window && get_current_user_id() !== $user ) {
    16511651                return $user;
    16521652        }
    16531653
     
    17451745        if ( $locked ) {
    17461746                $query_args = array();
    17471747                if ( get_post_type_object( $post->post_type )->public ) {
    1748                         if ( 'publish' === $post->post_status || $user->ID != $post->post_author ) {
     1748                        if ( 'publish' === $post->post_status || $user->ID !== $post->post_author ) {
    17491749                                // Latest content is in autosave.
    17501750                                $nonce                       = wp_create_nonce( 'post_preview_' . $post->ID );
    17511751                                $query_args['preview_id']    = $post->ID;
     
    19341934
    19351935        $is_autosave = false;
    19361936
    1937         if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author
     1937        if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() === $post->post_author
    19381938                && ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status )
    19391939        ) {
    19401940                $saved_post_id = edit_post();
     
    20092009                $post_data['post_category'] = explode( ',', $post_data['catslist'] );
    20102010        }
    20112011
    2012         if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author
     2012        if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() === $post->post_author
    20132013                && ( 'auto-draft' === $post->post_status || 'draft' === $post->post_status )
    20142014        ) {
    20152015                // Drafts and auto-drafts are just overwritten by autosave for the same user if the post is not locked.
     
    23192319
    23202320                        $meta_boxes = (array) $wp_meta_boxes[ $current_screen->id ][ $location ][ $priority ];
    23212321                        foreach ( $meta_boxes as $meta_box ) {
    2322                                 if ( false == $meta_box || ! $meta_box['title'] ) {
     2322                                if ( false === $meta_box || ! $meta_box['title'] ) {
    23232323                                        continue;
    23242324                                }
    23252325
  • src/wp-admin/includes/schema.php

     
    3838
    3939        $charset_collate = $wpdb->get_charset_collate();
    4040
    41         if ( $blog_id && $blog_id != $wpdb->blogid ) {
     41        if ( $blog_id && $blog_id !== $wpdb->blogid ) {
    4242                $old_blog_id = $wpdb->set_blog_id( $blog_id );
    4343        }
    4444
     
    991991                        $errors->add( 'siteid_exists', __( 'The network already exists.' ) );
    992992                }
    993993        } else {
    994                 if ( $network_id == $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) ) {
     994                if ( $network_id === $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) ) {
    995995                        $errors->add( 'siteid_exists', __( 'The network already exists.' ) );
    996996                }
    997997        }
     
    10041004                return $errors;
    10051005        }
    10061006
    1007         if ( 1 == $network_id ) {
     1007        if ( 1 === $network_id ) {
    10081008                $wpdb->insert(
    10091009                        $wpdb->site,
    10101010                        array(
     
    10851085                );
    10861086                if ( is_wp_error( $page ) ) {
    10871087                        $errstr = $page->get_error_message();
    1088                 } elseif ( 200 == wp_remote_retrieve_response_code( $page ) ) {
     1088                } elseif ( 200 === wp_remote_retrieve_response_code( $page ) ) {
    10891089                                $vhost_ok = true;
    10901090                }
    10911091
     
    11511151        $stylesheet     = get_option( 'stylesheet' );
    11521152        $allowed_themes = array( $stylesheet => true );
    11531153
    1154         if ( $template != $stylesheet ) {
     1154        if ( $template !== $stylesheet ) {
    11551155                $allowed_themes[ $template ] = true;
    11561156        }
    11571157
    1158         if ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template ) {
     1158        if ( WP_DEFAULT_THEME !== $stylesheet && WP_DEFAULT_THEME !== $template ) {
    11591159                $allowed_themes[ WP_DEFAULT_THEME ] = true;
    11601160        }
    11611161
  • src/wp-admin/includes/taxonomy.php

     
    188188function wp_update_category( $catarr ) {
    189189        $cat_ID = (int) $catarr['cat_ID'];
    190190
    191         if ( isset( $catarr['category_parent'] ) && ( $cat_ID == $catarr['category_parent'] ) ) {
     191        if ( isset( $catarr['category_parent'] ) && ( $cat_ID === $catarr['category_parent'] ) ) {
    192192                return false;
    193193        }
    194194
  • src/wp-admin/includes/update.php

     
    145145                $response = wp_remote_get( $http_url, $options );
    146146        }
    147147
    148         if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
     148        if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
    149149                return false;
    150150        }
    151151
     
    212212
    213213        $updates = $from_api->updates;
    214214        foreach ( $updates as $update ) {
    215                 if ( $update->current == $version && $update->locale == $locale ) {
     215                if ( $update->current === $version && $update->locale === $locale ) {
    216216                        return $update;
    217217                }
    218218        }
  • src/wp-admin/includes/upgrade.php

     
    161161
    162162                if ( global_terms_enabled() ) {
    163163                        $cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
    164                         if ( null == $cat_id ) {
     164                        if ( null === $cat_id ) {
    165165                                $wpdb->insert(
    166166                                        $wpdb->sitecategories,
    167167                                        array(
     
    459459
    460460                        // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.)
    461461                        // TODO: Get previous_blog_id.
    462                         if ( ! is_super_admin( $user_id ) && 1 != $user_id ) {
     462                        if ( ! is_super_admin( $user_id ) && 1 !== $user_id ) {
    463463                                $wpdb->delete(
    464464                                        $wpdb->usermeta,
    465465                                        array(
     
    648648                $wp_current_db_version = __get_option( 'db_version' );
    649649
    650650                // We are up to date. Nothing to do.
    651                 if ( $wp_db_version == $wp_current_db_version ) {
     651                if ( $wp_db_version === $wp_current_db_version ) {
    652652                        return;
    653653                }
    654654
     
    701701        $wp_current_db_version = __get_option( 'db_version' );
    702702
    703703        // We are up to date. Nothing to do.
    704         if ( $wp_db_version == $wp_current_db_version ) {
     704        if ( $wp_db_version === $wp_current_db_version ) {
    705705                return;
    706706        }
    707707
     
    909909                foreach ( $allposts as $post ) {
    910910                        // Check to see if it's already been imported.
    911911                        $cat = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category ) );
    912                         if ( ! $cat && 0 != $post->post_category ) { // If there's no result.
     912                        if ( ! $cat && 0 !== $post->post_category ) { // If there's no result.
    913913                                $wpdb->insert(
    914914                                        $wpdb->post2cat,
    915915                                        array(
     
    10831083        // Some versions have multiple duplicate option_name rows with the same values.
    10841084        $options = $wpdb->get_results( "SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name" );
    10851085        foreach ( $options as $option ) {
    1086                 if ( 1 != $option->dupes ) { // Could this be done in the query?
     1086                if ( 1 !== $option->dupes ) { // Could this be done in the query?
    10871087                        $limit    = $option->dupes - 1;
    10881088                        $dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) );
    10891089                        if ( $dupe_ids ) {
     
    14331433                $links = $wpdb->get_results( "SELECT link_id, link_category FROM $wpdb->links" );
    14341434                if ( ! empty( $links ) ) {
    14351435                        foreach ( $links as $link ) {
    1436                                 if ( 0 == $link->link_category ) {
     1436                                if ( 0 === $link->link_category ) {
    14371437                                        continue;
    14381438                                }
    14391439                                if ( ! isset( $link_cat_id_map[ $link->link_category ] ) ) {
     
    16571657        if ( $wp_current_db_version < 11958 ) {
    16581658                // Previously, setting depth to 1 would redundantly disable threading,
    16591659                // but now 2 is the minimum depth to avoid confusion.
    1660                 if ( get_option( 'thread_comments_depth' ) == '1' ) {
     1660                if ( get_option( 'thread_comments_depth' ) === '1' ) {
    16611661                        update_option( 'thread_comments_depth', 2 );
    16621662                        update_option( 'thread_comments', 0 );
    16631663                }
     
    17651765                                                $found = false;
    17661766
    17671767                                                foreach ( $wp_registered_widgets as $widget_id => $widget ) {
    1768                                                         if ( strtolower( $widget['name'] ) == strtolower( $name ) ) {
     1768                                                        if ( strtolower( $widget['name'] ) === strtolower( $name ) ) {
    17691769                                                                $_sidebars_widgets[ $index ][ $i ] = $widget['id'];
    17701770                                                                $found                             = true;
    17711771                                                                break;
    1772                                                         } elseif ( sanitize_title( $widget['name'] ) == sanitize_title( $name ) ) {
     1772                                                        } elseif ( sanitize_title( $widget['name'] ) === sanitize_title( $name ) ) {
    17731773                                                                $_sidebars_widgets[ $index ][ $i ] = $widget['id'];
    17741774                                                                $found                             = true;
    17751775                                                                break;
     
    24232423                        $upgrade = false;
    24242424                        $indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" );
    24252425                        foreach ( $indexes as $index ) {
    2426                                 if ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && 140 != $index->Sub_part ) {
     2426                                if ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && 140 !== $index->Sub_part ) {
    24272427                                        $upgrade = true;
    24282428                                        break;
    24292429                                }
     
    29552955                                $fieldtype_lowercased = strtolower( $fieldtype );
    29562956
    29572957                                // Is actual field type different from the field type in query?
    2958                                 if ( $tablefield->Type != $fieldtype ) {
     2958                                if ( $tablefield->Type !== $fieldtype ) {
    29592959                                        $do_change = true;
    29602960                                        if ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) {
    29612961                                                if ( array_search( $fieldtype_lowercased, $text_fields, true ) < array_search( $tablefield_type_lowercased, $text_fields, true ) ) {
     
    29802980                                // Get the default value from the array.
    29812981                                if ( preg_match( "| DEFAULT '(.*?)'|i", $cfields[ $tablefield_field_lowercased ], $matches ) ) {
    29822982                                        $default_value = $matches[1];
    2983                                         if ( $tablefield->Default != $default_value ) {
     2983                                        if ( $tablefield->Default !== $default_value ) {
    29842984                                                // Add a query to change the column's default value
    29852985                                                $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN `{$tablefield->Field}` SET DEFAULT '{$default_value}'";
    29862986
     
    30193019                                        'fieldname' => $tableindex->Column_name,
    30203020                                        'subpart'   => $tableindex->Sub_part,
    30213021                                );
    3022                                 $index_ary[ $keyname ]['unique']     = ( 0 == $tableindex->Non_unique ) ? true : false;
     3022                                $index_ary[ $keyname ]['unique']     = ( 0 === $tableindex->Non_unique ) ? true : false;
    30233023                                $index_ary[ $keyname ]['index_type'] = $tableindex->Index_type;
    30243024                        }
    30253025
     
    33413341
    33423342        // Make the new site theme active.
    33433343        $current_template = __get_option( 'template' );
    3344         if ( WP_DEFAULT_THEME == $current_template ) {
     3344        if ( WP_DEFAULT_THEME === $current_template ) {
    33453345                update_option( 'template', $template );
    33463346                update_option( 'stylesheet', $template );
    33473347        }
  • src/wp-admin/includes/user.php

     
    173173        }
    174174
    175175        // Checking the password has been typed twice the same.
    176         if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {
     176        if ( ( $update || ! empty( $pass1 ) ) && $pass1 !== $pass2 ) {
    177177                $errors->add( 'pass', __( '<strong>Error</strong>: Passwords do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
    178178        }
    179179
     
    203203                $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address is not correct.' ), array( 'form-field' => 'email' ) );
    204204        } else {
    205205                $owner_id = email_exists( $user->user_email );
    206                 if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {
     206                if ( $owner_id && ( ! $update || ( $owner_id !== $user->ID ) ) ) {
    207207                        $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );
    208208                }
    209209        }
     
    479479
    480480        // get_user_setting() = JS-saved UI setting. Else no-js-fallback code.
    481481        if ( 'hide' === get_user_setting( 'default_password_nag' )
    482                 || isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag']
     482                || isset( $_GET['default_password_nag'] ) && '0' === $_GET['default_password_nag']
    483483        ) {
    484484                delete_user_setting( 'default_password_nag' );
    485485                update_user_meta( $user_ID, 'default_password_nag', false );
     
    501501        $new_data = get_userdata( $user_ID );
    502502
    503503        // Remove the nag if the password has been changed.
    504         if ( $new_data->user_pass != $old_data->user_pass ) {
     504        if ( $new_data->user_pass !== $old_data->user_pass ) {
    505505                delete_user_setting( 'default_password_nag' );
    506506                update_user_meta( $user_ID, 'default_password_nag', false );
    507507        }
  • src/wp-admin/maint/repair.php

     
    7070
    7171        echo '<h1 class="screen-reader-text">' . __( 'Database repair results' ) . '</h1>';
    7272
    73         $optimize = 2 == $_GET['repair'];
     73        $optimize = 2 === $_GET['repair'];
    7474        $okay     = true;
    7575        $problems = array();
    7676
  • src/wp-admin/network/sites.php

     
    102102                        header( 'Content-Type: text/html; charset=utf-8' );
    103103                }
    104104
    105                 if ( get_network()->site_id == $id ) {
     105                if ( get_network()->site_id === $id ) {
    106106                        wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
    107107                }
    108108
     
    142142                        }
    143143
    144144                        $updated_action = 'not_deleted';
    145                         if ( '0' != $id && get_network()->site_id != $id && current_user_can( 'delete_site', $id ) ) {
     145                        if ( '0' !== $id && get_network()->site_id !== $id && current_user_can( 'delete_site', $id ) ) {
    146146                                wpmu_delete_blog( $id, true );
    147147                                $updated_action = 'delete';
    148148                        }
     
    154154                        foreach ( (array) $_POST['site_ids'] as $site_id ) {
    155155                                $site_id = (int) $site_id;
    156156
    157                                 if ( get_network()->site_id == $site_id ) {
     157                                if ( get_network()->site_id === $site_id ) {
    158158                                        continue;
    159159                                }
    160160
     
    182182                                $doaction = $_POST['action'];
    183183
    184184                                foreach ( (array) $_POST['allblogs'] as $key => $val ) {
    185                                         if ( '0' != $val && get_network()->site_id != $val ) {
     185                                        if ( '0' !== $val && get_network()->site_id !== $val ) {
    186186                                                switch ( $doaction ) {
    187187                                                        case 'delete':
    188188                                                                require_once ABSPATH . 'wp-admin/admin-header.php';
  • src/wp-admin/network/users.php

     
    9494                                                                $blogs        = get_blogs_of_user( $user_id, true );
    9595
    9696                                                                foreach ( (array) $blogs as $details ) {
    97                                                                         if ( get_network()->site_id != $details->userblog_id ) { // Main blog is not a spam!
     97                                                                        if ( get_network()->site_id !== $details->userblog_id ) { // Main blog is not a spam!
    9898                                                                                update_blog_status( $details->userblog_id, 'spam', '1' );
    9999                                                                        }
    100100                                                                }
     
    253253
    254254require_once ABSPATH . 'wp-admin/admin-header.php';
    255255
    256 if ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {
     256if ( isset( $_REQUEST['updated'] ) && 'true' === $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {
    257257        ?>
    258258        <div id="message" class="updated notice is-dismissible"><p>
    259259                <?php
  • src/wp-admin/options-general.php

     
    212212
    213213if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.
    214214        $check_zone_info = false;
    215         if ( 0 == $current_offset ) {
     215        if ( 0 === $current_offset ) {
    216216                $tzstring = 'UTC+0';
    217217        } elseif ( $current_offset < 0 ) {
    218218                $tzstring = 'UTC' . $current_offset;
     
    390390global $wp_locale;
    391391
    392392for ( $day_index = 0; $day_index <= 6; $day_index++ ) :
    393         $selected = ( get_option( 'start_of_week' ) == $day_index ) ? 'selected="selected"' : '';
     393        $selected = ( get_option( 'start_of_week' ) === $day_index ) ? 'selected="selected"' : '';
    394394        echo "\n\t<option value='" . esc_attr( $day_index ) . "' $selected>" . $wp_locale->get_weekday( $day_index ) . '</option>';
    395395endfor;
    396396?>
  • src/wp-admin/options-writing.php

     
    201201        ?>
    202202<h2 class="title"><?php _e( 'Update Services' ); ?></h2>
    203203
    204         <?php if ( 1 == get_option( 'blog_public' ) ) : ?>
     204        <?php if ( 1 === get_option( 'blog_public' ) ) : ?>
    205205
    206206        <p><label for="ping_sites">
    207207                <?php
  • src/wp-admin/update-core.php

     
    4242
    4343        if ( 'en_US' === $update->locale && 'en_US' === get_locale() ) {
    4444                $version_string = $update->current;
    45         } elseif ( 'en_US' === $update->locale && $update->packages->partial && $wp_version == $update->partial_version ) {
     45        } elseif ( 'en_US' === $update->locale && $update->packages->partial && $wp_version === $update->partial_version ) {
    4646                $updates = get_core_updates();
    4747                if ( $updates && 1 === count( $updates ) ) {
    4848                        // If the only available update is a partial builds, it doesn't need a language-specific version string.
     
    179179        }
    180180        echo '</p>';
    181181
    182         if ( 'en_US' !== $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package != $update->locale ) ) {
     182        if ( 'en_US' !== $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package !== $update->locale ) ) {
    183183                echo '<p class="hint">' . __( 'This localized version contains both the translation and various other localization fixes.' ) . '</p>';
    184         } elseif ( 'en_US' === $update->locale && 'en_US' !== get_locale() && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) {
     184        } elseif ( 'en_US' === $update->locale && 'en_US' !== get_locale() && ( ! $update->packages->partial && $wp_version === $update->partial_version ) ) {
    185185                // Partial builds don't need language-specific warnings.
    186186                echo '<p class="hint">' . sprintf(
    187187                        /* translators: %s: WordPress version. */
     
    890890
    891891        if ( is_wp_error( $result ) ) {
    892892                show_message( $result );
    893                 if ( 'up_to_date' != $result->get_error_code() && 'locked' != $result->get_error_code() ) {
     893                if ( 'up_to_date' !== $result->get_error_code() && 'locked' !== $result->get_error_code() ) {
    894894                        show_message( __( 'Installation failed.' ) );
    895895                }
    896896                echo '</div>';
  • src/wp-admin/user-new.php

     
    6363        $redirect       = 'user-new.php';
    6464        $username       = $user_details->user_login;
    6565        $user_id        = $user_details->ID;
    66         if ( null != $username && array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) {
     66        if ( null !== $username && array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) {
    6767                $redirect = add_query_arg( array( 'update' => 'addexisting' ), 'user-new.php' );
    6868        } else {
    6969                if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) {
  • src/wp-admin/users.php

     
    139139                        }
    140140
    141141                        // The new role of the current user must also have the promote_users cap or be a multisite super admin.
    142                         if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' )
     142                        if ( $id === $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' )
    143143                        && ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) {
    144144                                        $update = 'err_admin_role';
    145145                                        continue;
     
    194194                                wp_die( __( 'Sorry, you are not allowed to delete that user.' ), 403 );
    195195                        }
    196196
    197                         if ( $id == $current_user->ID ) {
     197                        if ( $id === $current_user->ID ) {
    198198                                $update = 'err_admin_del';
    199199                                continue;
    200200                        }
     
    335335                $go_delete = 0;
    336336                foreach ( $all_userids as $id ) {
    337337                        $user = get_userdata( $id );
    338                         if ( $id == $current_user->ID ) {
     338                        if ( $id === $current_user->ID ) {
    339339                                /* translators: 1: User ID, 2: User login. */
    340340                                echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ), $id, $user->user_login ) . "</li>\n";
    341341                        } else {
     
    353353                                ?>
    354354                        <input type="hidden" name="delete_option" value="delete" />
    355355                        <?php else : ?>
    356                                 <?php if ( 1 == $go_delete ) : ?>
     356                                <?php if ( 1 === $go_delete ) : ?>
    357357                        <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
    358358                <?php else : ?>
    359359                        <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
     
    529529                                case 'del':
    530530                                case 'del_many':
    531531                                        $delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0;
    532                                         if ( 1 == $delete_count ) {
     532                                        if ( 1 === $delete_count ) {
    533533                                                $message = __( 'User deleted.' );
    534534                                        } else {
    535535                                                /* translators: %s: Number of users. */