diff --git a/src/wp-admin/includes/ms.php b/src/wp-admin/includes/ms.php
index 54d638f6d8..2983952e8b 100644
a
|
b
|
function check_upload_size( $file ) { |
20 | 20 | return $file; |
21 | 21 | } |
22 | 22 | |
23 | | if ( $file['error'] != '0' ) { // there's already an error |
| 23 | if ( '0' != $file['error'] ) { // there's already an error |
24 | 24 | return $file; |
25 | 25 | } |
26 | 26 | |
… |
… |
function check_upload_size( $file ) { |
45 | 45 | $file['error'] = __( 'You have used your space quota. Please delete files before uploading.' ); |
46 | 46 | } |
47 | 47 | |
48 | | if ( $file['error'] != '0' && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) { |
| 48 | if ( ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) { |
49 | 49 | wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' ); |
50 | 50 | } |
51 | 51 | |
… |
… |
function update_user_status( $id, $pref, $value, $deprecated = null ) { |
339 | 339 | $user = new WP_User( $id ); |
340 | 340 | clean_user_cache( $user ); |
341 | 341 | |
342 | | if ( $pref == 'spam' ) { |
343 | | if ( $value == 1 ) { |
| 342 | if ( 'spam' === $pref ) { |
| 343 | if ( 1 === $value ) { |
344 | 344 | /** |
345 | 345 | * Fires after the user is marked as a SPAM user. |
346 | 346 | * |
… |
… |
function update_user_status( $id, $pref, $value, $deprecated = null ) { |
375 | 375 | function refresh_user_details( $id ) { |
376 | 376 | $id = (int) $id; |
377 | 377 | |
378 | | if ( ! $user = get_userdata( $id ) ) { |
| 378 | $user = get_userdata( $id ); |
| 379 | |
| 380 | if ( ! $user ) { |
379 | 381 | return false; |
380 | 382 | } |
381 | 383 | |
… |
… |
function format_code_lang( $code = '' ) { |
608 | 610 | * if `$taxonomy` is 'category' or 'post_tag'. |
609 | 611 | */ |
610 | 612 | function sync_category_tag_slugs( $term, $taxonomy ) { |
611 | | if ( global_terms_enabled() && ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) ) { |
| 613 | if ( global_terms_enabled() && ( 'category' === $taxonomy || 'post_tag' === $taxonomy ) ) { |
612 | 614 | if ( is_object( $term ) ) { |
613 | 615 | $term->slug = sanitize_title( $term->name ); |
614 | 616 | } else { |
… |
… |
function mu_dropdown_languages( $lang_files = array(), $current = '' ) { |
707 | 709 | } |
708 | 710 | } |
709 | 711 | |
710 | | if ( $flag === false ) { // WordPress english |
| 712 | if ( false === $flag ) { // WordPress english |
711 | 713 | $output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . '</option>'; |
712 | 714 | } |
713 | 715 | |
… |
… |
function site_admin_notice() { |
745 | 747 | return false; |
746 | 748 | } |
747 | 749 | |
748 | | if ( 'upgrade.php' == $pagenow ) { |
| 750 | if ( 'upgrade.php' === $pagenow ) { |
749 | 751 | return; |
750 | 752 | } |
751 | 753 | |
… |
… |
function avoid_blog_page_permalink_collision( $data, $postarr ) { |
770 | 772 | if ( is_subdomain_install() ) { |
771 | 773 | return $data; |
772 | 774 | } |
773 | | if ( $data['post_type'] != 'page' ) { |
| 775 | if ( 'page' !== $data['post_type'] ) { |
774 | 776 | return $data; |
775 | 777 | } |
776 | | if ( ! isset( $data['post_name'] ) || $data['post_name'] == '' ) { |
| 778 | if ( ! isset( $data['post_name'] ) || '' === $data['post_name'] ) { |
777 | 779 | return $data; |
778 | 780 | } |
779 | 781 | if ( ! is_main_site() ) { |
… |
… |
function avoid_blog_page_permalink_collision( $data, $postarr ) { |
786 | 788 | $post_name .= mt_rand( 1, 10 ); |
787 | 789 | $c ++; |
788 | 790 | } |
789 | | if ( $post_name != $data['post_name'] ) { |
| 791 | if ( $data['post_name'] != $post_name ) { |
790 | 792 | $data['post_name'] = $post_name; |
791 | 793 | } |
792 | 794 | return $data; |
… |
… |
function choose_primary_blog() { |
816 | 818 | <select name="primary_blog" id="primary_blog"> |
817 | 819 | <?php |
818 | 820 | foreach ( (array) $all_blogs as $blog ) { |
819 | | if ( $primary_blog == $blog->userblog_id ) { |
| 821 | if ( $blog->userblog_id == $primary_blog ) { |
820 | 822 | $found = true; |
821 | 823 | } |
822 | 824 | ?> |
… |
… |
function choose_primary_blog() { |
830 | 832 | $blog = reset( $all_blogs ); |
831 | 833 | update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); |
832 | 834 | } |
833 | | } elseif ( count( $all_blogs ) == 1 ) { |
| 835 | } elseif ( 1 === count( $all_blogs ) ) { |
834 | 836 | $blog = reset( $all_blogs ); |
835 | 837 | echo esc_url( get_home_url( $blog->userblog_id ) ); |
836 | 838 | if ( $primary_blog != $blog->userblog_id ) { // Set the primary blog again if it's out of sync with blog list. |
… |
… |
function choose_primary_blog() { |
858 | 860 | * @return bool True if network can be edited, otherwise false. |
859 | 861 | */ |
860 | 862 | function can_edit_network( $network_id ) { |
861 | | if ( $network_id == get_current_network_id() ) { |
| 863 | if ( get_current_network_id() === $network_id ) { |
862 | 864 | $result = true; |
863 | 865 | } else { |
864 | 866 | $result = false; |
… |
… |
function confirm_delete_users( $users ) { |
901 | 903 | ?> |
902 | 904 | <h1><?php esc_html_e( 'Users' ); ?></h1> |
903 | 905 | |
904 | | <?php if ( 1 == count( $users ) ) : ?> |
| 906 | <?php if ( 1 === count( $users ) ) : ?> |
905 | 907 | <p><?php _e( 'You have chosen to delete the user from all networks and sites.' ); ?></p> |
906 | 908 | <?php else : ?> |
907 | 909 | <p><?php _e( 'You have chosen to delete the following users from all networks and sites.' ); ?></p> |
… |
… |
function confirm_delete_users( $users ) { |
916 | 918 | ?> |
917 | 919 | <table class="form-table" role="presentation"> |
918 | 920 | <?php |
919 | | foreach ( ( $allusers = (array) $_POST['allusers'] ) as $user_id ) { |
920 | | if ( $user_id != '' && $user_id != '0' ) { |
| 921 | $allusers = (array) $_POST['allusers']; |
| 922 | foreach ( $allusers as $user_id ) { |
| 923 | if ( '' !== $user_id && '0' != $user_id ) { |
921 | 924 | $delete_user = get_userdata( $user_id ); |
922 | 925 | |
923 | 926 | if ( ! current_user_can( 'delete_user', $delete_user->ID ) ) { |
… |
… |
function confirm_delete_users( $users ) { |
964 | 967 | $user_list .= "<option value='{$user->ID}'>{$user->user_login}</option>"; |
965 | 968 | } |
966 | 969 | } |
967 | | if ( '' == $user_list ) { |
| 970 | if ( '' === $user_list ) { |
968 | 971 | $user_list = $admin_out; |
969 | 972 | } |
970 | 973 | $user_dropdown .= $user_list; |
… |
… |
function confirm_delete_users( $users ) { |
997 | 1000 | /** This action is documented in wp-admin/users.php */ |
998 | 1001 | do_action( 'delete_user_form', $current_user, $allusers ); |
999 | 1002 | |
1000 | | if ( 1 == count( $users ) ) : |
| 1003 | if ( 1 === count( $users ) ) : |
1001 | 1004 | ?> |
1002 | 1005 | <p><?php _e( 'Once you hit “Confirm Deletion”, the user will be permanently removed.' ); ?></p> |
1003 | 1006 | <?php else : ?> |