Ticket #54728: 54728.6.diff
File 54728.6.diff, 50.6 KB (added by , 3 years ago) |
---|
-
src/wp-admin/includes/ajax-actions.php
148 148 * Require $term_search_min_chars chars for matching (default: 2) 149 149 * ensure it's a non-negative, non-zero integer. 150 150 */ 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 ) ) { 152 152 wp_die(); 153 153 } 154 154 … … 188 188 $force_gzip = ( defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ); 189 189 $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."'; 190 190 191 if ( 1 == $_GET['test'] ) {191 if ( 1 === $_GET['test'] ) { 192 192 echo $test_str; 193 193 wp_die(); 194 } elseif ( 2 == $_GET['test'] ) {194 } elseif ( 2 === $_GET['test'] ) { 195 195 if ( ! isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) { 196 196 wp_die( -1 ); 197 197 } … … 482 482 } 483 483 484 484 // 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 ) ) { 486 486 $post_id = 0; 487 487 // What type of comment count are we looking for? 488 488 $status = 'all'; … … 702 702 $status = wp_get_comment_status( $comment ); 703 703 $delta = -1; 704 704 705 if ( isset( $_POST['trash'] ) && 1 == $_POST['trash'] ) {705 if ( isset( $_POST['trash'] ) && 1 === $_POST['trash'] ) { 706 706 if ( 'trash' === $status ) { 707 707 wp_die( time() ); 708 708 } 709 709 710 710 $r = wp_trash_comment( $comment ); 711 } elseif ( isset( $_POST['untrash'] ) && 1 == $_POST['untrash'] ) {711 } elseif ( isset( $_POST['untrash'] ) && 1 === $_POST['untrash'] ) { 712 712 if ( 'trash' !== $status ) { 713 713 wp_die( time() ); 714 714 } … … 719 719 if ( ! isset( $_POST['comment_status'] ) || 'trash' !== $_POST['comment_status'] ) { 720 720 $delta = 1; 721 721 } 722 } elseif ( isset( $_POST['spam'] ) && 1 == $_POST['spam'] ) {722 } elseif ( isset( $_POST['spam'] ) && 1 === $_POST['spam'] ) { 723 723 if ( 'spam' === $status ) { 724 724 wp_die( time() ); 725 725 } 726 726 727 727 $r = wp_spam_comment( $comment ); 728 } elseif ( isset( $_POST['unspam'] ) && 1 == $_POST['unspam'] ) {728 } elseif ( isset( $_POST['unspam'] ) && 1 === $_POST['unspam'] ) { 729 729 if ( 'spam' !== $status ) { 730 730 wp_die( time() ); 731 731 } … … 736 736 if ( ! isset( $_POST['comment_status'] ) || 'spam' !== $_POST['comment_status'] ) { 737 737 $delta = 1; 738 738 } 739 } elseif ( isset( $_POST['delete'] ) && 1 == $_POST['delete'] ) {739 } elseif ( isset( $_POST['delete'] ) && 1 === $_POST['delete'] ) { 740 740 $r = wp_delete_comment( $comment ); 741 741 } else { 742 742 wp_die( -1 ); … … 969 969 970 970 $current = wp_get_comment_status( $comment ); 971 971 972 if ( isset( $_POST['new'] ) && $_POST['new'] == $current ) {972 if ( isset( $_POST['new'] ) && $_POST['new'] === $current ) { 973 973 wp_die( time() ); 974 974 } 975 975 … … 1299 1299 $_POST['_wp_unfiltered_html_comment'] = ''; 1300 1300 } 1301 1301 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'] ) { 1303 1303 kses_remove_filters(); // Start with a clean slate. 1304 1304 kses_init_filters(); // Set up the filters. 1305 1305 remove_filter( 'pre_comment_content', 'wp_filter_post_kses' ); … … 1327 1327 if ( ! empty( $_POST['approve_parent'] ) ) { 1328 1328 $parent = get_comment( $comment_parent ); 1329 1329 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 ) { 1331 1331 if ( ! current_user_can( 'edit_comment', $parent->comment_ID ) ) { 1332 1332 wp_die( -1 ); 1333 1333 } … … 1426 1426 } 1427 1427 1428 1428 $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; 1430 1430 $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) ); 1431 1431 1432 1432 $comment = get_comment( $comment_id ); … … 1635 1635 wp_die( -1 ); 1636 1636 } 1637 1637 1638 if ( $meta->meta_value != $value || $meta->meta_key != $key ) {1638 if ( $meta->meta_value !== $value || $meta->meta_key !== $key ) { 1639 1639 $u = update_metadata_by_mid( 'post', $mid, $value, $key ); 1640 1640 if ( ! $u ) { 1641 1641 wp_die( 0 ); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). … … 1733 1733 1734 1734 $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; 1735 1735 1736 if ( sanitize_key( $page ) != $page ) {1736 if ( sanitize_key( $page ) !== $page ) { 1737 1737 wp_die( 0 ); 1738 1738 } 1739 1739 … … 1764 1764 check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' ); 1765 1765 $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; 1766 1766 1767 if ( sanitize_key( $page ) != $page ) {1767 if ( sanitize_key( $page ) !== $page ) { 1768 1768 wp_die( 0 ); 1769 1769 } 1770 1770 … … 1919 1919 1920 1920 $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; 1921 1921 1922 if ( sanitize_key( $page ) != $page ) {1922 if ( sanitize_key( $page ) !== $page ) { 1923 1923 wp_die( 0 ); 1924 1924 } 1925 1925 … … 2347 2347 2348 2348 foreach ( (array) $wp_registered_widget_updates as $name => $control ) { 2349 2349 2350 if ( $name == $id_base ) {2350 if ( $name === $id_base ) { 2351 2351 if ( ! is_callable( $control['callback'] ) ) { 2352 2352 continue; 2353 2353 } … … 2673 2673 check_ajax_referer( "set_post_thumbnail-$post_ID" ); 2674 2674 } 2675 2675 2676 if ( '-1' == $thumbnail_id ) {2676 if ( '-1' === $thumbnail_id ) { 2677 2677 if ( delete_post_thumbnail( $post_ID ) ) { 2678 2678 $return = _wp_post_thumbnail_html( null, $post_ID ); 2679 2679 $json ? wp_send_json_success( $return ) : wp_die( $return ); … … 2853 2853 2854 2854 $active_lock = array_map( 'absint', explode( ':', $_POST['active_post_lock'] ) ); 2855 2855 2856 if ( get_current_user_id() != $active_lock[1] ) {2856 if ( get_current_user_id() !== $active_lock[1] ) { 2857 2857 wp_die( 0 ); 2858 2858 } 2859 2859 … … 2878 2878 function wp_ajax_dismiss_wp_pointer() { 2879 2879 $pointer = $_POST['pointer']; 2880 2880 2881 if ( sanitize_key( $pointer ) != $pointer ) {2881 if ( sanitize_key( $pointer ) !== $pointer ) { 2882 2882 wp_die( 0 ); 2883 2883 } 2884 2884 … … 3249 3249 // If this attachment is unattached, attach it. Primarily a back compat thing. 3250 3250 $insert_into_post_id = (int) $_POST['post_id']; 3251 3251 3252 if ( 0 == $post->post_parent && $insert_into_post_id ) {3252 if ( 0 === $post->post_parent && $insert_into_post_id ) { 3253 3253 wp_update_post( 3254 3254 array( 3255 3255 'ID' => $id, … … 3260 3260 } 3261 3261 3262 3262 $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 ); 3264 3264 3265 3265 remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' ); 3266 3266 … … 3929 3929 $wp_site_icon = new WP_Site_Icon(); 3930 3930 3931 3931 // 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 ) { 3933 3933 3934 3934 // Delete the temporary cropped file, we don't need it. 3935 3935 wp_delete_file( $cropped ); -
src/wp-admin/includes/class-wp-importer.php
40 40 $hashtable[ $r->meta_value ] = (int) $r->post_id; 41 41 } 42 42 } 43 } while ( count( $results ) == $limit );43 } while ( count( $results ) === $limit ); 44 44 45 45 return $hashtable; 46 46 } … … 104 104 $source_comment_id = (int) $source_comment_id; 105 105 106 106 // Check if this comment came from this blog. 107 if ( $blog_id == $comment_agent_blog_id ) {107 if ( $blog_id === $comment_agent_blog_id ) { 108 108 $hashtable[ $source_comment_id ] = (int) $r->comment_ID; 109 109 } 110 110 } 111 111 } 112 } while ( count( $results ) == $limit );112 } while ( count( $results ) === $limit ); 113 113 114 114 return $hashtable; 115 115 } -
src/wp-admin/includes/class-wp-list-table.php
526 526 return false; 527 527 } 528 528 529 if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {529 if ( isset( $_REQUEST['action'] ) && -1 !== $_REQUEST['action'] ) { 530 530 return $_REQUEST['action']; 531 531 } 532 532 … … 643 643 644 644 $month_count = count( $months ); 645 645 646 if ( ! $month_count || ( 1 == $month_count && 0== $months[0]->month ) ) {646 if ( ! $month_count || ( 1 === $month_count && 0 === $months[0]->month ) ) { 647 647 return; 648 648 } 649 649 … … 654 654 <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option> 655 655 <?php 656 656 foreach ( $months as $arc_row ) { 657 if ( 0 == $arc_row->year ) {657 if ( 0 === $arc_row->year ) { 658 658 continue; 659 659 } 660 660 … … 906 906 $disable_prev = false; 907 907 $disable_next = false; 908 908 909 if ( 1 == $current ) {909 if ( 1 === $current ) { 910 910 $disable_first = true; 911 911 $disable_prev = true; 912 912 } 913 if ( $total_pages == $current ) {913 if ( $total_pages === $current ) { 914 914 $disable_last = true; 915 915 $disable_next = true; 916 916 } -
src/wp-admin/includes/class-wp-ms-sites-list-table.php
591 591 reset( $this->status_list ); 592 592 593 593 foreach ( $this->status_list as $status => $col ) { 594 if ( 1 == $blog[ $status ] ) {594 if ( 1 === $blog[ $status ] ) { 595 595 $class = " class='{$col[0]}'"; 596 596 } 597 597 } … … 706 706 707 707 $actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a>'; 708 708 $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'] ) { 711 711 $actions['activate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a>'; 712 712 } else { 713 713 $actions['deactivate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Deactivate' ) . '</a>'; 714 714 } 715 715 716 if ( '1' == $blog['archived'] ) {716 if ( '1' === $blog['archived'] ) { 717 717 $actions['unarchive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a>'; 718 718 } else { 719 719 $actions['archive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a>'; 720 720 } 721 721 722 if ( '1' == $blog['spam'] ) {722 if ( '1' === $blog['spam'] ) { 723 723 $actions['unspam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a>'; 724 724 } else { 725 725 $actions['spam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Spam', 'site' ) . '</a>'; -
src/wp-admin/includes/class-wp-privacy-policy-content.php
104 104 105 105 // The == operator (equal, not identical) was used intentionally. 106 106 // See http://php.net/manual/en/language.operators.array.php 107 if ( $new != $old ) {107 if ( $new !== $old ) { 108 108 // A plugin was activated or deactivated, or some policy text has changed. 109 109 // Show a notice on the relevant screens to inform the admin. 110 110 add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) ); -
src/wp-admin/includes/class-wp-site-icon.php
202 202 public function delete_attachment_data( $post_id ) { 203 203 $site_icon_id = get_option( 'site_icon' ); 204 204 205 if ( $site_icon_id && $post_id == $site_icon_id ) {205 if ( $site_icon_id && $post_id === $site_icon_id ) { 206 206 delete_option( 'site_icon' ); 207 207 } 208 208 } … … 223 223 if ( $single && '_wp_attachment_backup_sizes' === $meta_key ) { 224 224 $site_icon_id = get_option( 'site_icon' ); 225 225 226 if ( $post_id == $site_icon_id ) {226 if ( $post_id === $site_icon_id ) { 227 227 add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) ); 228 228 } 229 229 } -
src/wp-admin/includes/image-edit.php
554 554 $filtered = array( $changes[0] ); 555 555 for ( $i = 0, $j = 1, $c = count( $changes ); $j < $c; $j++ ) { 556 556 $combined = false; 557 if ( $filtered[ $i ]->type == $changes[ $j ]->type ) {557 if ( $filtered[ $i ]->type === $changes[ $j ]->type ) { 558 558 switch ( $filtered[ $i ]->type ) { 559 559 case 'rotate': 560 560 $filtered[ $i ]->angle += $changes[ $j ]->angle; … … 603 603 foreach ( $changes as $operation ) { 604 604 switch ( $operation->type ) { 605 605 case 'rotate': 606 if ( 0 != $operation->angle ) {606 if ( 0 !== $operation->angle ) { 607 607 if ( $image instanceof WP_Image_Editor ) { 608 608 $image->rotate( $operation->angle ); 609 609 } else { … … 612 612 } 613 613 break; 614 614 case 'flip': 615 if ( 0 != $operation->axis ) {615 if ( 0 !== $operation->axis ) { 616 616 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 ); 618 618 } 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 ); 620 620 } 621 621 } 622 622 break; … … 711 711 if ( isset( $backup_sizes['full-orig'] ) && is_array( $backup_sizes['full-orig'] ) ) { 712 712 $data = $backup_sizes['full-orig']; 713 713 714 if ( $parts['basename'] != $data['file'] ) {714 if ( $parts['basename'] !== $data['file'] ) { 715 715 if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) { 716 716 717 717 // Delete only if it's an edited image. … … 738 738 foreach ( $default_sizes as $default_size ) { 739 739 if ( isset( $backup_sizes[ "$default_size-orig" ] ) ) { 740 740 $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'] ) { 742 742 if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) { 743 743 744 744 // Delete only if it's an edited image. … … 853 853 $suffix = time() . rand( 100, 999 ); 854 854 855 855 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 ) { 857 857 858 858 if ( 'thumbnail' === $target ) { 859 859 $new_path = "{$dirname}/{$filename}-temp.{$ext}"; … … 943 943 $tag = false; 944 944 if ( isset( $meta['sizes'][ $size ] ) ) { 945 945 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'] ) { 947 947 $tag = "$size-$suffix"; 948 948 } 949 949 } else { -
src/wp-admin/includes/media.php
93 93 foreach ( $tabs as $callback => $text ) { 94 94 $class = ''; 95 95 96 if ( $current == $callback ) {96 if ( $current === $callback ) { 97 97 $class = " class='current'"; 98 98 } 99 99 … … 750 750 $post['menu_order'] = $attachment['menu_order']; 751 751 } 752 752 753 if ( isset( $send_id ) && $attachment_id == $send_id ) {753 if ( isset( $send_id ) && $attachment_id === $send_id ) { 754 754 if ( isset( $attachment['post_parent'] ) ) { 755 755 $post['post_parent'] = $attachment['post_parent']; 756 756 } … … 784 784 unset( $post['errors'] ); 785 785 } 786 786 787 if ( $post != $_post ) {787 if ( $post !== $_post ) { 788 788 wp_update_post( $post ); 789 789 } 790 790 … … 814 814 if ( ! empty( $attachment['url'] ) ) { 815 815 $rel = ''; 816 816 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'] ) { 818 818 $rel = " rel='attachment wp-att-" . esc_attr( $send_id ) . "'"; 819 819 } 820 820 … … 1146 1146 foreach ( $alignments as $name => $label ) { 1147 1147 $name = esc_attr( $name ); 1148 1148 $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'" : '' ) . 1150 1150 " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>"; 1151 1151 } 1152 1152 … … 1196 1196 $css_id = "image-size-{$size}-{$post->ID}"; 1197 1197 1198 1198 // If this size is the default but that's not available, don't select it. 1199 if ( $size == $check ) {1199 if ( $size === $check ) { 1200 1200 if ( $enabled ) { 1201 1201 $checked = " checked='checked'"; 1202 1202 } else { … … 1336 1336 */ 1337 1337 function image_attachment_fields_to_save( $post, $attachment ) { 1338 1338 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 ) { 1340 1340 $attachment_url = ( isset( $post['attachment_url'] ) ) ? $post['attachment_url'] : $post['guid']; 1341 1341 $post['post_title'] = preg_replace( '/\.\w+$/', '', wp_basename( $attachment_url ) ); 1342 1342 $post['errors']['post_title']['errors'][] = __( 'Empty Title filled from filename.' ); … … 1761 1761 if ( 'image' === $type && $calling_post_id 1762 1762 && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) 1763 1763 && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) 1764 && get_post_thumbnail_id( $calling_post_id ) != $attachment_id1764 && get_post_thumbnail_id( $calling_post_id ) !== $attachment_id 1765 1765 ) { 1766 1766 1767 1767 $calling_post = get_post( $calling_post_id ); … … 2840 2840 $month_count = count( $arc_result ); 2841 2841 $selected_month = isset( $_GET['m'] ) ? $_GET['m'] : 0; 2842 2842 2843 if ( $month_count && ! ( 1 == $month_count && 0== $arc_result[0]->mmonth ) ) {2843 if ( $month_count && ! ( 1 === $month_count && 0 === $arc_result[0]->mmonth ) ) { 2844 2844 ?> 2845 2845 <select name='m'> 2846 2846 <option<?php selected( $selected_month, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option> … … 2847 2847 <?php 2848 2848 2849 2849 foreach ( $arc_result as $arc_row ) { 2850 if ( 0 == $arc_row->yyear ) {2850 if ( 0 === $arc_row->yyear ) { 2851 2851 continue; 2852 2852 } 2853 2853 2854 2854 $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 ); 2855 2855 2856 if ( $arc_row->yyear . $arc_row->mmonth == $selected_month ) {2856 if ( $arc_row->yyear . $arc_row->mmonth === $selected_month ) { 2857 2857 $default = ' selected="selected"'; 2858 2858 } else { 2859 2859 $default = ''; -
src/wp-admin/includes/menu.php
106 106 * If the first submenu is not the same as the assigned parent, 107 107 * make the first submenu the new parent. 108 108 */ 109 if ( $new_parent != $old_parent ) {109 if ( $new_parent !== $old_parent ) { 110 110 $_wp_real_parent_file[ $old_parent ] = $new_parent; 111 111 $menu[ $id ][2] = $new_parent; 112 112 … … 171 171 if ( ! empty( $submenu[ $data[2] ] ) && 1 === count( $submenu[ $data[2] ] ) ) { 172 172 $subs = $submenu[ $data[2] ]; 173 173 $first_sub = reset( $subs ); 174 if ( $data[2] == $first_sub[2] ) {174 if ( $data[2] === $first_sub[2] ) { 175 175 unset( $submenu[ $data[2] ] ); 176 176 } 177 177 } … … 208 208 foreach ( $menu as $order => $top ) { 209 209 $i++; 210 210 211 if ( 0 == $order ) { // Dashboard is always shown/single.211 if ( 0 === $order ) { // Dashboard is always shown/single. 212 212 $menu[0][4] = add_cssclass( 'menu-top-first', $top[4] ); 213 213 $lastorder = 0; 214 214 continue; … … 227 227 $first = false; 228 228 } 229 229 230 if ( $mc == $i ) { // Last item.230 if ( $mc === $i ) { // Last item. 231 231 $c = $menu[ $order ][4]; 232 232 $menu[ $order ][4] = add_cssclass( 'menu-top-last', $c ); 233 233 } … … 297 297 } elseif ( ! isset( $menu_order[ $a ] ) && isset( $menu_order[ $b ] ) ) { 298 298 return 1; 299 299 } 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 ] ) { 301 301 return 0; 302 302 } 303 303 return ( $menu_order[ $a ] < $menu_order[ $b ] ) ? -1 : 1; -
src/wp-admin/includes/meta-boxes.php
973 973 endif; // End empty pages check. 974 974 endif; // End hierarchical check. 975 975 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 ) : 977 977 $template = ! empty( $post->page_template ) ? $post->page_template : false; 978 978 ?> 979 979 <p class="post-attributes-label-wrapper page-template-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label> … … 1366 1366 <?php 1367 1367 for ( $rating = 0; $rating <= 10; $rating++ ) { 1368 1368 echo '<option value="' . $rating . '"'; 1369 if ( isset( $link->link_rating ) && $link->link_rating == $rating ) {1369 if ( isset( $link->link_rating ) && $link->link_rating === $rating ) { 1370 1370 echo ' selected="selected"'; 1371 1371 } 1372 1372 echo '>' . $rating . '</option>'; -
src/wp-admin/includes/nav-menu.php
926 926 $menu_id = (int) $menu_id; 927 927 $items_saved = array(); 928 928 929 if ( 0 == $menu_id || is_nav_menu( $menu_id ) ) {929 if ( 0 === $menu_id || is_nav_menu( $menu_id ) ) { 930 930 931 931 // Loop through all the menu items' POST values. 932 932 foreach ( (array) $menu_data as $_possible_db_id => $_item_object_data ) { … … 952 952 if ( 953 953 empty( $_item_object_data['menu-item-db-id'] ) || 954 954 ( 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'] 956 956 ) { 957 957 $_actual_db_id = 0; 958 958 } else { … … 1199 1199 $args[ $field ] = isset( $_POST[ $field ][ $_key ] ) ? $_POST[ $field ][ $_key ] : ''; 1200 1200 } 1201 1201 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 ); 1203 1203 1204 1204 if ( is_wp_error( $menu_item_db_id ) ) { 1205 1205 $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>'; … … 1289 1289 1290 1290 // Build the new array value from leaf to trunk. 1291 1291 for ( $i = count( $array_bits ) - 1; $i >= 0; $i-- ) { 1292 if ( count( $array_bits ) - 1 == $i ) {1292 if ( count( $array_bits ) - 1 === $i ) { 1293 1293 $new_post_data[ $array_bits[ $i ] ] = wp_slash( $post_input_data->value ); 1294 1294 } else { 1295 1295 $new_post_data = array( $array_bits[ $i ] => $new_post_data ); -
src/wp-admin/includes/post.php
72 72 } 73 73 } 74 74 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'] ) 76 76 && ! current_user_can( $ptype->cap->edit_others_posts ) ) { 77 77 78 78 if ( $update ) { … … 163 163 } 164 164 165 165 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 ] ) { 167 167 $post_data['edit_date'] = '1'; 168 168 break; 169 169 } … … 360 360 if ( ! $meta ) { 361 361 continue; 362 362 } 363 if ( $meta->post_id != $post_ID ) {363 if ( $meta->post_id !== $post_ID ) { 364 364 continue; 365 365 } 366 366 if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $meta->meta_key ) ) { … … 379 379 if ( ! $meta ) { 380 380 continue; 381 381 } 382 if ( $meta->post_id != $post_ID ) {382 if ( $meta->post_id !== $post_ID ) { 383 383 continue; 384 384 } 385 385 if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $post_ID, $meta->meta_key ) ) { … … 489 489 } 490 490 } 491 491 492 if ( -1 == $post_data['_status'] ) {492 if ( -1 === $post_data['_status'] ) { 493 493 $post_data['post_status'] = null; 494 494 unset( $post_data['post_status'] ); 495 495 } else { … … 523 523 ); 524 524 525 525 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 ] ) ) { 527 527 unset( $post_data[ $field ] ); 528 528 } 529 529 } … … 1106 1106 $url_id = (int) $url_match[2]; 1107 1107 $rel_id = (int) $rel_match[1]; 1108 1108 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 ) { 1110 1110 continue; 1111 1111 } 1112 1112 … … 1337 1337 * @return string Space-separated string of class names. 1338 1338 */ 1339 1339 function postbox_classes( $box_id, $screen_id ) { 1340 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) {1340 if ( isset( $_GET['edit'] ) && $_GET['edit'] === $box_id ) { 1341 1341 $classes = array( '' ); 1342 1342 } elseif ( get_user_option( 'closedpostboxes_' . $screen_id ) ) { 1343 1343 $closed = get_user_option( 'closedpostboxes_' . $screen_id ); … … 1504 1504 1505 1505 // Encourage a pretty permalink setting. 1506 1506 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 ) 1508 1508 ) { 1509 1509 $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __( 'Change Permalinks' ) . "</a></span>\n"; 1510 1510 } … … 1647 1647 /** This filter is documented in wp-admin/includes/ajax-actions.php */ 1648 1648 $time_window = apply_filters( 'wp_check_post_lock_window', 150 ); 1649 1649 1650 if ( $time && $time > time() - $time_window && get_current_user_id() != $user ) {1650 if ( $time && $time > time() - $time_window && get_current_user_id() !== $user ) { 1651 1651 return $user; 1652 1652 } 1653 1653 … … 1745 1745 if ( $locked ) { 1746 1746 $query_args = array(); 1747 1747 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 ) { 1749 1749 // Latest content is in autosave. 1750 1750 $nonce = wp_create_nonce( 'post_preview_' . $post->ID ); 1751 1751 $query_args['preview_id'] = $post->ID; … … 1934 1934 1935 1935 $is_autosave = false; 1936 1936 1937 if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author1937 if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() === $post->post_author 1938 1938 && ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status ) 1939 1939 ) { 1940 1940 $saved_post_id = edit_post(); … … 2009 2009 $post_data['post_category'] = explode( ',', $post_data['catslist'] ); 2010 2010 } 2011 2011 2012 if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author2012 if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() === $post->post_author 2013 2013 && ( 'auto-draft' === $post->post_status || 'draft' === $post->post_status ) 2014 2014 ) { 2015 2015 // Drafts and auto-drafts are just overwritten by autosave for the same user if the post is not locked. … … 2319 2319 2320 2320 $meta_boxes = (array) $wp_meta_boxes[ $current_screen->id ][ $location ][ $priority ]; 2321 2321 foreach ( $meta_boxes as $meta_box ) { 2322 if ( false == $meta_box || ! $meta_box['title'] ) {2322 if ( false === $meta_box || ! $meta_box['title'] ) { 2323 2323 continue; 2324 2324 } 2325 2325 -
src/wp-admin/includes/schema.php
38 38 39 39 $charset_collate = $wpdb->get_charset_collate(); 40 40 41 if ( $blog_id && $blog_id != $wpdb->blogid ) {41 if ( $blog_id && $blog_id !== $wpdb->blogid ) { 42 42 $old_blog_id = $wpdb->set_blog_id( $blog_id ); 43 43 } 44 44 … … 991 991 $errors->add( 'siteid_exists', __( 'The network already exists.' ) ); 992 992 } 993 993 } 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 ) ) ) { 995 995 $errors->add( 'siteid_exists', __( 'The network already exists.' ) ); 996 996 } 997 997 } … … 1004 1004 return $errors; 1005 1005 } 1006 1006 1007 if ( 1 == $network_id ) {1007 if ( 1 === $network_id ) { 1008 1008 $wpdb->insert( 1009 1009 $wpdb->site, 1010 1010 array( … … 1085 1085 ); 1086 1086 if ( is_wp_error( $page ) ) { 1087 1087 $errstr = $page->get_error_message(); 1088 } elseif ( 200 == wp_remote_retrieve_response_code( $page ) ) {1088 } elseif ( 200 === wp_remote_retrieve_response_code( $page ) ) { 1089 1089 $vhost_ok = true; 1090 1090 } 1091 1091 … … 1151 1151 $stylesheet = get_option( 'stylesheet' ); 1152 1152 $allowed_themes = array( $stylesheet => true ); 1153 1153 1154 if ( $template != $stylesheet ) {1154 if ( $template !== $stylesheet ) { 1155 1155 $allowed_themes[ $template ] = true; 1156 1156 } 1157 1157 1158 if ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template ) {1158 if ( WP_DEFAULT_THEME !== $stylesheet && WP_DEFAULT_THEME !== $template ) { 1159 1159 $allowed_themes[ WP_DEFAULT_THEME ] = true; 1160 1160 } 1161 1161 -
src/wp-admin/includes/taxonomy.php
188 188 function wp_update_category( $catarr ) { 189 189 $cat_ID = (int) $catarr['cat_ID']; 190 190 191 if ( isset( $catarr['category_parent'] ) && ( $cat_ID == $catarr['category_parent'] ) ) {191 if ( isset( $catarr['category_parent'] ) && ( $cat_ID === $catarr['category_parent'] ) ) { 192 192 return false; 193 193 } 194 194 -
src/wp-admin/includes/update.php
145 145 $response = wp_remote_get( $http_url, $options ); 146 146 } 147 147 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 ) ) { 149 149 return false; 150 150 } 151 151 … … 212 212 213 213 $updates = $from_api->updates; 214 214 foreach ( $updates as $update ) { 215 if ( $update->current == $version && $update->locale== $locale ) {215 if ( $update->current === $version && $update->locale === $locale ) { 216 216 return $update; 217 217 } 218 218 } -
src/wp-admin/includes/upgrade.php
161 161 162 162 if ( global_terms_enabled() ) { 163 163 $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 ) { 165 165 $wpdb->insert( 166 166 $wpdb->sitecategories, 167 167 array( … … 459 459 460 460 // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) 461 461 // 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 ) { 463 463 $wpdb->delete( 464 464 $wpdb->usermeta, 465 465 array( … … 648 648 $wp_current_db_version = __get_option( 'db_version' ); 649 649 650 650 // 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 ) { 652 652 return; 653 653 } 654 654 … … 701 701 $wp_current_db_version = __get_option( 'db_version' ); 702 702 703 703 // 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 ) { 705 705 return; 706 706 } 707 707 … … 909 909 foreach ( $allposts as $post ) { 910 910 // Check to see if it's already been imported. 911 911 $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. 913 913 $wpdb->insert( 914 914 $wpdb->post2cat, 915 915 array( … … 1083 1083 // Some versions have multiple duplicate option_name rows with the same values. 1084 1084 $options = $wpdb->get_results( "SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name" ); 1085 1085 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? 1087 1087 $limit = $option->dupes - 1; 1088 1088 $dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) ); 1089 1089 if ( $dupe_ids ) { … … 1433 1433 $links = $wpdb->get_results( "SELECT link_id, link_category FROM $wpdb->links" ); 1434 1434 if ( ! empty( $links ) ) { 1435 1435 foreach ( $links as $link ) { 1436 if ( 0 == $link->link_category ) {1436 if ( 0 === $link->link_category ) { 1437 1437 continue; 1438 1438 } 1439 1439 if ( ! isset( $link_cat_id_map[ $link->link_category ] ) ) { … … 1657 1657 if ( $wp_current_db_version < 11958 ) { 1658 1658 // Previously, setting depth to 1 would redundantly disable threading, 1659 1659 // 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' ) { 1661 1661 update_option( 'thread_comments_depth', 2 ); 1662 1662 update_option( 'thread_comments', 0 ); 1663 1663 } … … 1765 1765 $found = false; 1766 1766 1767 1767 foreach ( $wp_registered_widgets as $widget_id => $widget ) { 1768 if ( strtolower( $widget['name'] ) == strtolower( $name ) ) {1768 if ( strtolower( $widget['name'] ) === strtolower( $name ) ) { 1769 1769 $_sidebars_widgets[ $index ][ $i ] = $widget['id']; 1770 1770 $found = true; 1771 1771 break; 1772 } elseif ( sanitize_title( $widget['name'] ) == sanitize_title( $name ) ) {1772 } elseif ( sanitize_title( $widget['name'] ) === sanitize_title( $name ) ) { 1773 1773 $_sidebars_widgets[ $index ][ $i ] = $widget['id']; 1774 1774 $found = true; 1775 1775 break; … … 2423 2423 $upgrade = false; 2424 2424 $indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" ); 2425 2425 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 ) { 2427 2427 $upgrade = true; 2428 2428 break; 2429 2429 } … … 2955 2955 $fieldtype_lowercased = strtolower( $fieldtype ); 2956 2956 2957 2957 // Is actual field type different from the field type in query? 2958 if ( $tablefield->Type != $fieldtype ) {2958 if ( $tablefield->Type !== $fieldtype ) { 2959 2959 $do_change = true; 2960 2960 if ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) { 2961 2961 if ( array_search( $fieldtype_lowercased, $text_fields, true ) < array_search( $tablefield_type_lowercased, $text_fields, true ) ) { … … 2980 2980 // Get the default value from the array. 2981 2981 if ( preg_match( "| DEFAULT '(.*?)'|i", $cfields[ $tablefield_field_lowercased ], $matches ) ) { 2982 2982 $default_value = $matches[1]; 2983 if ( $tablefield->Default != $default_value ) {2983 if ( $tablefield->Default !== $default_value ) { 2984 2984 // Add a query to change the column's default value 2985 2985 $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN `{$tablefield->Field}` SET DEFAULT '{$default_value}'"; 2986 2986 … … 3019 3019 'fieldname' => $tableindex->Column_name, 3020 3020 'subpart' => $tableindex->Sub_part, 3021 3021 ); 3022 $index_ary[ $keyname ]['unique'] = ( 0 == $tableindex->Non_unique ) ? true : false;3022 $index_ary[ $keyname ]['unique'] = ( 0 === $tableindex->Non_unique ) ? true : false; 3023 3023 $index_ary[ $keyname ]['index_type'] = $tableindex->Index_type; 3024 3024 } 3025 3025 … … 3341 3341 3342 3342 // Make the new site theme active. 3343 3343 $current_template = __get_option( 'template' ); 3344 if ( WP_DEFAULT_THEME == $current_template ) {3344 if ( WP_DEFAULT_THEME === $current_template ) { 3345 3345 update_option( 'template', $template ); 3346 3346 update_option( 'stylesheet', $template ); 3347 3347 } -
src/wp-admin/includes/user.php
173 173 } 174 174 175 175 // Checking the password has been typed twice the same. 176 if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {176 if ( ( $update || ! empty( $pass1 ) ) && $pass1 !== $pass2 ) { 177 177 $errors->add( 'pass', __( '<strong>Error</strong>: Passwords do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) ); 178 178 } 179 179 … … 203 203 $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address is not correct.' ), array( 'form-field' => 'email' ) ); 204 204 } else { 205 205 $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 ) ) ) { 207 207 $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) ); 208 208 } 209 209 } … … 479 479 480 480 // get_user_setting() = JS-saved UI setting. Else no-js-fallback code. 481 481 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'] 483 483 ) { 484 484 delete_user_setting( 'default_password_nag' ); 485 485 update_user_meta( $user_ID, 'default_password_nag', false ); … … 501 501 $new_data = get_userdata( $user_ID ); 502 502 503 503 // 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 ) { 505 505 delete_user_setting( 'default_password_nag' ); 506 506 update_user_meta( $user_ID, 'default_password_nag', false ); 507 507 } -
src/wp-admin/maint/repair.php
70 70 71 71 echo '<h1 class="screen-reader-text">' . __( 'Database repair results' ) . '</h1>'; 72 72 73 $optimize = 2 == $_GET['repair'];73 $optimize = 2 === $_GET['repair']; 74 74 $okay = true; 75 75 $problems = array(); 76 76 -
src/wp-admin/network/sites.php
102 102 header( 'Content-Type: text/html; charset=utf-8' ); 103 103 } 104 104 105 if ( get_network()->site_id == $id ) {105 if ( get_network()->site_id === $id ) { 106 106 wp_die( __( 'Sorry, you are not allowed to change the current site.' ) ); 107 107 } 108 108 … … 142 142 } 143 143 144 144 $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 ) ) { 146 146 wpmu_delete_blog( $id, true ); 147 147 $updated_action = 'delete'; 148 148 } … … 154 154 foreach ( (array) $_POST['site_ids'] as $site_id ) { 155 155 $site_id = (int) $site_id; 156 156 157 if ( get_network()->site_id == $site_id ) {157 if ( get_network()->site_id === $site_id ) { 158 158 continue; 159 159 } 160 160 … … 182 182 $doaction = $_POST['action']; 183 183 184 184 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 ) { 186 186 switch ( $doaction ) { 187 187 case 'delete': 188 188 require_once ABSPATH . 'wp-admin/admin-header.php'; -
src/wp-admin/network/users.php
94 94 $blogs = get_blogs_of_user( $user_id, true ); 95 95 96 96 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! 98 98 update_blog_status( $details->userblog_id, 'spam', '1' ); 99 99 } 100 100 } … … 253 253 254 254 require_once ABSPATH . 'wp-admin/admin-header.php'; 255 255 256 if ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {256 if ( isset( $_REQUEST['updated'] ) && 'true' === $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) { 257 257 ?> 258 258 <div id="message" class="updated notice is-dismissible"><p> 259 259 <?php -
src/wp-admin/options-general.php
212 212 213 213 if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists. 214 214 $check_zone_info = false; 215 if ( 0 == $current_offset ) {215 if ( 0 === $current_offset ) { 216 216 $tzstring = 'UTC+0'; 217 217 } elseif ( $current_offset < 0 ) { 218 218 $tzstring = 'UTC' . $current_offset; … … 390 390 global $wp_locale; 391 391 392 392 for ( $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"' : ''; 394 394 echo "\n\t<option value='" . esc_attr( $day_index ) . "' $selected>" . $wp_locale->get_weekday( $day_index ) . '</option>'; 395 395 endfor; 396 396 ?> -
src/wp-admin/options-writing.php
201 201 ?> 202 202 <h2 class="title"><?php _e( 'Update Services' ); ?></h2> 203 203 204 <?php if ( 1 == get_option( 'blog_public' ) ) : ?>204 <?php if ( 1 === get_option( 'blog_public' ) ) : ?> 205 205 206 206 <p><label for="ping_sites"> 207 207 <?php -
src/wp-admin/update-core.php
42 42 43 43 if ( 'en_US' === $update->locale && 'en_US' === get_locale() ) { 44 44 $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 ) { 46 46 $updates = get_core_updates(); 47 47 if ( $updates && 1 === count( $updates ) ) { 48 48 // If the only available update is a partial builds, it doesn't need a language-specific version string. … … 179 179 } 180 180 echo '</p>'; 181 181 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 ) ) { 183 183 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 ) ) { 185 185 // Partial builds don't need language-specific warnings. 186 186 echo '<p class="hint">' . sprintf( 187 187 /* translators: %s: WordPress version. */ … … 890 890 891 891 if ( is_wp_error( $result ) ) { 892 892 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() ) { 894 894 show_message( __( 'Installation failed.' ) ); 895 895 } 896 896 echo '</div>'; -
src/wp-admin/user-new.php
63 63 $redirect = 'user-new.php'; 64 64 $username = $user_details->user_login; 65 65 $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 ) ) ) { 67 67 $redirect = add_query_arg( array( 'update' => 'addexisting' ), 'user-new.php' ); 68 68 } else { 69 69 if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { -
src/wp-admin/users.php
139 139 } 140 140 141 141 // 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' ) 143 143 && ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) { 144 144 $update = 'err_admin_role'; 145 145 continue; … … 194 194 wp_die( __( 'Sorry, you are not allowed to delete that user.' ), 403 ); 195 195 } 196 196 197 if ( $id == $current_user->ID ) {197 if ( $id === $current_user->ID ) { 198 198 $update = 'err_admin_del'; 199 199 continue; 200 200 } … … 335 335 $go_delete = 0; 336 336 foreach ( $all_userids as $id ) { 337 337 $user = get_userdata( $id ); 338 if ( $id == $current_user->ID ) {338 if ( $id === $current_user->ID ) { 339 339 /* translators: 1: User ID, 2: User login. */ 340 340 echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ), $id, $user->user_login ) . "</li>\n"; 341 341 } else { … … 353 353 ?> 354 354 <input type="hidden" name="delete_option" value="delete" /> 355 355 <?php else : ?> 356 <?php if ( 1 == $go_delete ) : ?>356 <?php if ( 1 === $go_delete ) : ?> 357 357 <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p> 358 358 <?php else : ?> 359 359 <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p> … … 529 529 case 'del': 530 530 case 'del_many': 531 531 $delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0; 532 if ( 1 == $delete_count ) {532 if ( 1 === $delete_count ) { 533 533 $message = __( 'User deleted.' ); 534 534 } else { 535 535 /* translators: %s: Number of users. */