Make WordPress Core


Ignore:
Timestamp:
05/24/2020 09:14:21 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-admin/network where static strings are involved.

Includes minor code layout fixes for better readability.

Follow-up to [47808].

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-settings.php

    r47550 r47853  
    3535$is_main_site = is_main_site( $id );
    3636
    37 if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] && is_array( $_POST['option'] ) ) {
     37if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] && is_array( $_POST['option'] ) ) {
    3838    check_admin_referer( 'edit-site' );
    3939
     
    4545        $val = wp_unslash( $val );
    4646        if ( 0 === $key || is_array( $val ) || in_array( $key, $skip_options, true ) ) {
    47             continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options.
     47            continue; // Avoids "0 is a protected WP option and may not be modified" error when editing blog options.
    4848        }
    4949        update_option( $key, $val );
     
    7575if ( isset( $_GET['update'] ) ) {
    7676    $messages = array();
    77     if ( 'updated' == $_GET['update'] ) {
     77    if ( 'updated' === $_GET['update'] ) {
    7878        $messages[] = __( 'Site options updated.' );
    7979    }
     
    124124        );
    125125        $options     = $wpdb->get_results( $query );
     126
    126127        foreach ( $options as $option ) {
    127128            if ( 'default_role' === $option->option_name ) {
    128129                $editblog_default_role = $option->option_value;
    129130            }
     131
    130132            $disabled = false;
    131133            $class    = 'all-options';
     134
    132135            if ( is_serialized( $option->option_value ) ) {
    133136                if ( is_serialized_string( $option->option_value ) ) {
     
    139142                }
    140143            }
     144
    141145            if ( strpos( $option->option_value, "\n" ) !== false ) {
    142146                ?>
     
    159163            }
    160164        } // End foreach.
     165
    161166        /**
    162167         * Fires at the end of the Edit Site form, before the submit button.
Note: See TracChangeset for help on using the changeset viewer.