diff --git a/src/wp-admin/includes/ms.php b/src/wp-admin/includes/ms.php
index 76af47f8af..ca3a87ca6e 100644
|
a
|
b
|
function wpmu_delete_blog( $blog_id, $drop = false ) { |
| 67 | 67 | global $wpdb; |
| 68 | 68 | |
| 69 | 69 | $switch = false; |
| 70 | | if ( get_current_blog_id() != $blog_id ) { |
| | 70 | if ( get_current_blog_id() !== (int) $blog_id ) { |
| 71 | 71 | $switch = true; |
| 72 | 72 | switch_to_blog( $blog_id ); |
| 73 | 73 | } |
| … |
… |
function wpmu_delete_blog( $blog_id, $drop = false ) { |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // Don't destroy the initial, main, or root blog. |
| 85 | | if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_network->path && $blog->domain == $current_network->domain ) ) ) { |
| | 85 | if ( $drop && ( 1 === (int) $blog_id || is_main_site( $blog_id ) || ( $blog->path === $current_network->path && $blog->domain == $current_network->domain ) ) ) { |
| 86 | 86 | $drop = false; |
| 87 | 87 | } |
| 88 | 88 | |
| … |
… |
function site_admin_notice() { |
| 702 | 702 | return; |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | | if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) { |
| | 705 | if ( get_site_option( 'wpmu_upgrade_site' ) !== $wp_db_version ) { |
| 706 | 706 | echo "<div class='update-nag notice notice-warning inline'>" . sprintf( |
| 707 | 707 | /* translators: %s: URL to Upgrade Network screen. */ |
| 708 | 708 | __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ), |
| … |
… |
function avoid_blog_page_permalink_collision( $data, $postarr ) { |
| 746 | 746 | $post_name .= mt_rand( 1, 10 ); |
| 747 | 747 | $c ++; |
| 748 | 748 | } |
| 749 | | if ( $post_name != $data['post_name'] ) { |
| | 749 | if ( $data['post_name'] !== $post_name ) { |
| 750 | 750 | $data['post_name'] = $post_name; |
| 751 | 751 | } |
| 752 | 752 | return $data; |
| … |
… |
function choose_primary_blog() { |
| 769 | 769 | <td> |
| 770 | 770 | <?php |
| 771 | 771 | $all_blogs = get_blogs_of_user( get_current_user_id() ); |
| 772 | | $primary_blog = get_user_meta( get_current_user_id(), 'primary_blog', true ); |
| | 772 | $primary_blog = (int) get_user_meta( get_current_user_id(), 'primary_blog', true ); |
| 773 | 773 | if ( count( $all_blogs ) > 1 ) { |
| 774 | 774 | $found = false; |
| 775 | 775 | ?> |
| 776 | 776 | <select name="primary_blog" id="primary_blog"> |
| 777 | 777 | <?php |
| 778 | 778 | foreach ( (array) $all_blogs as $blog ) { |
| 779 | | if ( $primary_blog == $blog->userblog_id ) { |
| | 779 | if ( $blog->userblog_id === $primary_blog ) { |
| 780 | 780 | $found = true; |
| 781 | 781 | } |
| 782 | 782 | ?> |
| … |
… |
function choose_primary_blog() { |
| 790 | 790 | $blog = reset( $all_blogs ); |
| 791 | 791 | update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); |
| 792 | 792 | } |
| 793 | | } elseif ( count( $all_blogs ) == 1 ) { |
| | 793 | } elseif ( 1 === count( $all_blogs ) ) { |
| 794 | 794 | $blog = reset( $all_blogs ); |
| 795 | 795 | echo esc_url( get_home_url( $blog->userblog_id ) ); |
| 796 | | if ( $primary_blog != $blog->userblog_id ) { // Set the primary blog again if it's out of sync with blog list. |
| | 796 | if ( $blog->userblog_id !== $primary_blog ) { // Set the primary blog again if it's out of sync with blog list. |
| 797 | 797 | update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); |
| 798 | 798 | } |
| 799 | 799 | } else { |
| … |
… |
function choose_primary_blog() { |
| 818 | 818 | * @return bool True if network can be edited, otherwise false. |
| 819 | 819 | */ |
| 820 | 820 | function can_edit_network( $network_id ) { |
| 821 | | if ( get_current_network_id() == $network_id ) { |
| | 821 | if ( get_current_network_id() === (int) $network_id ) { |
| 822 | 822 | $result = true; |
| 823 | 823 | } else { |
| 824 | 824 | $result = false; |
| … |
… |
function confirm_delete_users( $users ) { |
| 878 | 878 | <?php |
| 879 | 879 | $allusers = (array) $_POST['allusers']; |
| 880 | 880 | foreach ( $allusers as $user_id ) { |
| 881 | | if ( '' !== $user_id && '0' != $user_id ) { |
| | 881 | if ( '' !== $user_id && 0 !== (int) $user_id ) { |
| 882 | 882 | $delete_user = get_userdata( $user_id ); |
| 883 | 883 | |
| 884 | 884 | if ( ! current_user_can( 'delete_user', $delete_user->ID ) ) { |