WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/07/2015 05:11:01 PM (5 years ago)
Author:
jeremyfelt
Message:

Revert [34778], continue using _site_option() for the current network.

The _network_option() parameter order will be changing to accept $network_id first. The _site_option() functions will remain in use throughout core as our way of retrieving a network option for the current network.

See #28290.

File:
1 edited

Legend:

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

    r34778 r34912  
    7777            continue;
    7878        $value = wp_unslash( $_POST[$option_name] );
    79         update_network_option( $option_name, $value );
     79        update_site_option( $option_name, $value );
    8080    }
    8181
     
    114114                <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
    115115                <td>
    116                     <input name="admin_email" type="email" id="admin_email" aria-describedby="admin-email-desc" class="regular-text" value="<?php echo esc_attr( get_network_option( 'admin_email' ) ) ?>" />
     116                    <input name="admin_email" type="email" id="admin_email" aria-describedby="admin-email-desc" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ) ?>" />
    117117                    <p class="description" id="admin-email-desc">
    118118                        <?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?>
     
    126126                <th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
    127127                <?php
    128                 if ( !get_network_option( 'registration' ) )
    129                     update_network_option( 'registration', 'none' );
    130                 $reg = get_network_option( 'registration' );
     128                if ( !get_site_option( 'registration' ) )
     129                    update_site_option( 'registration', 'none' );
     130                $reg = get_site_option( 'registration' );
    131131                ?>
    132132                <td>
     
    147147                <th scope="row"><?php _e( 'Registration notification' ) ?></th>
    148148                <?php
    149                 if ( !get_network_option( 'registrationnotification' ) )
    150                     update_network_option( 'registrationnotification', 'yes' );
     149                if ( !get_site_option( 'registrationnotification' ) )
     150                    update_site_option( 'registrationnotification', 'yes' );
    151151                ?>
    152152                <td>
    153                     <label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_network_option( 'registrationnotification' ), 'yes' ) ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?></label>
     153                    <label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ) ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?></label>
    154154                </td>
    155155            </tr>
     
    158158                <th scope="row"><?php _e( 'Add New Users' ) ?></th>
    159159                <td>
    160                     <label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_network_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users &rarr; Add New" page.' ); ?></label>
     160                    <label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users &rarr; Add New" page.' ); ?></label>
    161161                </td>
    162162            </tr>
     
    165165                <th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
    166166                <td>
    167                     <input name="illegal_names" type="text" id="illegal_names" aria-describedby="illegal-names-desc" class="large-text" value="<?php echo esc_attr( implode( " ", (array) get_network_option( 'illegal_names' ) ) ); ?>" size="45" />
     167                    <input name="illegal_names" type="text" id="illegal_names" aria-describedby="illegal-names-desc" class="large-text" value="<?php echo esc_attr( implode( " ", (array) get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
    168168                    <p class="description" id="illegal-names-desc">
    169169                        <?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
     
    175175                <th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
    176176                <td>
    177                     <?php $limited_email_domains = get_network_option( 'limited_email_domains' );
     177                    <?php $limited_email_domains = get_site_option( 'limited_email_domains' );
    178178                    $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
    179179                    <textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5">
     
    189189                <td>
    190190                    <textarea name="banned_email_domains" id="banned_email_domains" aria-describedby="banned-email-domains-desc" cols="45" rows="5">
    191 <?php echo esc_textarea( get_network_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_network_option( 'banned_email_domains' ) ) ); ?></textarea>
     191<?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
    192192                    <p class="description" id="banned-email-domains-desc">
    193193                        <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
     
    204204                <td>
    205205                    <textarea name="welcome_email" id="welcome_email" aria-describedby="welcome-email-desc" rows="5" cols="45" class="large-text">
    206 <?php echo esc_textarea( get_network_option( 'welcome_email' ) ) ?></textarea>
     206<?php echo esc_textarea( get_site_option( 'welcome_email' ) ) ?></textarea>
    207207                    <p class="description" id="welcome-email-desc">
    208208                        <?php _e( 'The welcome email sent to new site owners.' ) ?>
     
    214214                <td>
    215215                    <textarea name="welcome_user_email" id="welcome_user_email" aria-describedby="welcome-user-email-desc" rows="5" cols="45" class="large-text">
    216 <?php echo esc_textarea( get_network_option( 'welcome_user_email' ) ) ?></textarea>
     216<?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ) ?></textarea>
    217217                    <p class="description" id="welcome-user-email-desc">
    218218                        <?php _e( 'The welcome email sent to new users.' ) ?>
     
    224224                <td>
    225225                    <textarea name="first_post" id="first_post" aria-describedby="first-post-desc" rows="5" cols="45" class="large-text">
    226 <?php echo esc_textarea( get_network_option( 'first_post' ) ) ?></textarea>
     226<?php echo esc_textarea( get_site_option( 'first_post' ) ) ?></textarea>
    227227                    <p class="description" id="first-post-desc">
    228228                        <?php _e( 'The first post on a new site.' ) ?>
     
    234234                <td>
    235235                    <textarea name="first_page" id="first_page" aria-describedby="first-page-desc" rows="5" cols="45" class="large-text">
    236 <?php echo esc_textarea( get_network_option( 'first_page' ) ) ?></textarea>
     236<?php echo esc_textarea( get_site_option( 'first_page' ) ) ?></textarea>
    237237                    <p class="description" id="first-page-desc">
    238238                        <?php _e( 'The first page on a new site.' ) ?>
     
    244244                <td>
    245245                    <textarea name="first_comment" id="first_comment" aria-describedby="first-comment-desc" rows="5" cols="45" class="large-text">
    246 <?php echo esc_textarea( get_network_option( 'first_comment' ) ) ?></textarea>
     246<?php echo esc_textarea( get_site_option( 'first_comment' ) ) ?></textarea>
    247247                    <p class="description" id="first-comment-desc">
    248248                        <?php _e( 'The first comment on a new site.' ) ?>
     
    253253                <th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
    254254                <td>
    255                     <input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo get_network_option( 'first_comment_author' ) ?>" />
     255                    <input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo get_site_option('first_comment_author') ?>" />
    256256                    <p class="description" id="first-comment-author-desc">
    257257                        <?php _e( 'The author of the first comment on a new site.' ) ?>
     
    262262                <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
    263263                <td>
    264                     <input type="text" size="40" name="first_comment_url" id="first_comment_url" aria-describedby="first-comment-url-desc" value="<?php echo esc_attr( get_network_option( 'first_comment_url' ) ) ?>" />
     264                    <input type="text" size="40" name="first_comment_url" id="first_comment_url" aria-describedby="first-comment-url-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
    265265                    <p class="description" id="first-comment-url-desc">
    266266                        <?php _e( 'The URL for the first comment on a new site.' ) ?>
     
    274274                <th scope="row"><?php _e( 'Site upload space' ) ?></th>
    275275                <td>
    276                     <label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_network_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_network_option('blog_upload_space', 100) ) . '" />' ); ?></label><br />
     276                    <label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_site_option('blog_upload_space', 100) ) . '" />' ); ?></label><br />
    277277                    <p class="screen-reader-text" id="blog-upload-space-desc">
    278278                        <?php _e( 'Size in megabytes' ) ?>
     
    284284                <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
    285285                <td>
    286                     <input name="upload_filetypes" type="text" id="upload_filetypes" aria-describedby="upload-filetypes-desc" class="large-text" value="<?php echo esc_attr( get_network_option( 'upload_filetypes', 'jpg jpeg png gif' ) ) ?>" size="45" />
     286                    <input name="upload_filetypes" type="text" id="upload_filetypes" aria-describedby="upload-filetypes-desc" class="large-text" value="<?php echo esc_attr( get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ) ?>" size="45" />
    287287                    <p class="description" id="upload-filetypes-desc">
    288288                        <?php _e( 'Allowed file types. Separate types by spaces.' ) ?>
     
    294294                <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
    295295                <td>
    296                     <?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" aria-describedby="fileupload-maxk-desc" value="' . esc_attr( get_network_option( 'fileupload_maxk', 300 ) ) . '" />' ); ?>
     296                    <?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" aria-describedby="fileupload-maxk-desc" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />' ); ?>
    297297                    <p class="screen-reader-text" id="fileupload-maxk-desc">
    298298                        <?php _e( 'Size in kilobytes' ) ?>
     
    313313                    <td>
    314314                        <?php
    315                         $lang = get_network_option( 'WPLANG' );
     315                        $lang = get_site_option( 'WPLANG' );
    316316                        if ( ! in_array( $lang, $languages ) ) {
    317317                            $lang = '';
     
    340340                <td>
    341341            <?php
    342             $menu_perms = get_network_option( 'menu_items' );
     342            $menu_perms = get_site_option( 'menu_items' );
    343343            /**
    344344             * Filter available network-wide administration menu options.
Note: See TracChangeset for help on using the changeset viewer.