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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34912 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt
2015-10-07 17:11:01 +00:00
parent 9a704fa0b8
commit 599fb50e09
35 changed files with 192 additions and 192 deletions
+24 -24
View File
@@ -76,7 +76,7 @@ if ( $_POST ) {
if ( ! isset($_POST[$option_name]) )
continue;
$value = wp_unslash( $_POST[$option_name] );
update_network_option( $option_name, $value );
update_site_option( $option_name, $value );
}
/**
@@ -113,7 +113,7 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
<td>
<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' ) ) ?>" />
<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' ) ) ?>" />
<p class="description" id="admin-email-desc">
<?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?>
</p>
@@ -125,9 +125,9 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
<?php
if ( !get_network_option( 'registration' ) )
update_network_option( 'registration', 'none' );
$reg = get_network_option( 'registration' );
if ( !get_site_option( 'registration' ) )
update_site_option( 'registration', 'none' );
$reg = get_site_option( 'registration' );
?>
<td>
<fieldset>
@@ -146,25 +146,25 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><?php _e( 'Registration notification' ) ?></th>
<?php
if ( !get_network_option( 'registrationnotification' ) )
update_network_option( 'registrationnotification', 'yes' );
if ( !get_site_option( 'registrationnotification' ) )
update_site_option( 'registrationnotification', 'yes' );
?>
<td>
<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>
<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>
</td>
</tr>
<tr id="addnewusers">
<th scope="row"><?php _e( 'Add New Users' ) ?></th>
<td>
<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>
<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>
</td>
</tr>
<tr>
<th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
<td>
<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" />
<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" />
<p class="description" id="illegal-names-desc">
<?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
</p>
@@ -174,7 +174,7 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
<td>
<?php $limited_email_domains = get_network_option( 'limited_email_domains' );
<?php $limited_email_domains = get_site_option( 'limited_email_domains' );
$limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
<textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5">
<?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
@@ -188,7 +188,7 @@ if ( isset( $_GET['updated'] ) ) {
<th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
<td>
<textarea name="banned_email_domains" id="banned_email_domains" aria-describedby="banned-email-domains-desc" cols="45" rows="5">
<?php echo esc_textarea( get_network_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_network_option( 'banned_email_domains' ) ) ); ?></textarea>
<?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
<p class="description" id="banned-email-domains-desc">
<?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
</p>
@@ -203,7 +203,7 @@ if ( isset( $_GET['updated'] ) ) {
<th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
<td>
<textarea name="welcome_email" id="welcome_email" aria-describedby="welcome-email-desc" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( get_network_option( 'welcome_email' ) ) ?></textarea>
<?php echo esc_textarea( get_site_option( 'welcome_email' ) ) ?></textarea>
<p class="description" id="welcome-email-desc">
<?php _e( 'The welcome email sent to new site owners.' ) ?>
</p>
@@ -213,7 +213,7 @@ if ( isset( $_GET['updated'] ) ) {
<th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
<td>
<textarea name="welcome_user_email" id="welcome_user_email" aria-describedby="welcome-user-email-desc" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( get_network_option( 'welcome_user_email' ) ) ?></textarea>
<?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ) ?></textarea>
<p class="description" id="welcome-user-email-desc">
<?php _e( 'The welcome email sent to new users.' ) ?>
</p>
@@ -223,7 +223,7 @@ if ( isset( $_GET['updated'] ) ) {
<th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
<td>
<textarea name="first_post" id="first_post" aria-describedby="first-post-desc" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( get_network_option( 'first_post' ) ) ?></textarea>
<?php echo esc_textarea( get_site_option( 'first_post' ) ) ?></textarea>
<p class="description" id="first-post-desc">
<?php _e( 'The first post on a new site.' ) ?>
</p>
@@ -233,7 +233,7 @@ if ( isset( $_GET['updated'] ) ) {
<th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
<td>
<textarea name="first_page" id="first_page" aria-describedby="first-page-desc" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( get_network_option( 'first_page' ) ) ?></textarea>
<?php echo esc_textarea( get_site_option( 'first_page' ) ) ?></textarea>
<p class="description" id="first-page-desc">
<?php _e( 'The first page on a new site.' ) ?>
</p>
@@ -243,7 +243,7 @@ if ( isset( $_GET['updated'] ) ) {
<th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
<td>
<textarea name="first_comment" id="first_comment" aria-describedby="first-comment-desc" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( get_network_option( 'first_comment' ) ) ?></textarea>
<?php echo esc_textarea( get_site_option( 'first_comment' ) ) ?></textarea>
<p class="description" id="first-comment-desc">
<?php _e( 'The first comment on a new site.' ) ?>
</p>
@@ -252,7 +252,7 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
<td>
<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' ) ?>" />
<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') ?>" />
<p class="description" id="first-comment-author-desc">
<?php _e( 'The author of the first comment on a new site.' ) ?>
</p>
@@ -261,7 +261,7 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
<td>
<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' ) ) ?>" />
<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' ) ) ?>" />
<p class="description" id="first-comment-url-desc">
<?php _e( 'The URL for the first comment on a new site.' ) ?>
</p>
@@ -273,7 +273,7 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><?php _e( 'Site upload space' ) ?></th>
<td>
<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 />
<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 />
<p class="screen-reader-text" id="blog-upload-space-desc">
<?php _e( 'Size in megabytes' ) ?>
</p>
@@ -283,7 +283,7 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
<td>
<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" />
<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" />
<p class="description" id="upload-filetypes-desc">
<?php _e( 'Allowed file types. Separate types by spaces.' ) ?>
</p>
@@ -293,7 +293,7 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
<td>
<?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 ) ) . '" />' ); ?>
<?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 ) ) . '" />' ); ?>
<p class="screen-reader-text" id="fileupload-maxk-desc">
<?php _e( 'Size in kilobytes' ) ?>
</p>
@@ -312,7 +312,7 @@ if ( isset( $_GET['updated'] ) ) {
<th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
<td>
<?php
$lang = get_network_option( 'WPLANG' );
$lang = get_site_option( 'WPLANG' );
if ( ! in_array( $lang, $languages ) ) {
$lang = '';
}
@@ -339,7 +339,7 @@ if ( isset( $_GET['updated'] ) ) {
<th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
<td>
<?php
$menu_perms = get_network_option( 'menu_items' );
$menu_perms = get_site_option( 'menu_items' );
/**
* Filter available network-wide administration menu options.
*