Deprecate get_blog_option(), add_blog_option(), update_blog_option(), and delete_blog_option().

Use the regular option functions wrapped in switch_to_blog() and restore_current_blog() instead.

Group multiple operations within a single switch where possible.

fixes #21432


git-svn-id: https://develop.svn.wordpress.org/trunk@21414 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-08-03 17:51:42 +00:00
parent a5c7405975
commit ce960f67a0
10 changed files with 208 additions and 166 deletions

View File

@@ -230,8 +230,11 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
echo "<td class='column-$column_name $column_name'$style>"; ?>
<a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a>
<?php
if ( 'list' != $mode )
echo '<p>' . sprintf( _x( '%1$s &#8211; <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '</p>';
if ( 'list' != $mode ) {
switch_to_blog( $blog['blog_id'] );
echo '<p>' . sprintf( _x( '%1$s &#8211; <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.' ), get_option( 'blogname' ), get_option( 'blogdescription ' ) ) . '</p>';
restore_current_blog();
}
// Preordered.
$actions = array(

View File

@@ -411,7 +411,10 @@ function fix_import_form_size( $size ) {
// Edit blog upload space setting on Edit Blog page
function upload_space_setting( $id ) {
$quota = get_blog_option( $id, 'blog_upload_space' );
switch_to_blog( $id );
$quota = get_option( 'blog_upload_space' );
restore_current_blog();
if ( !$quota )
$quota = '';