Make WordPress Core


Ignore:
Timestamp:
08/03/2012 05:51:42 PM (14 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

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

    r20713 r21414  
    136136            <?php if ( $is_main_site ) { ?>
    137137            <td><code><?php echo esc_attr( $details->path ) ?></code></td>
    138             <?php } else { ?>
     138            <?php
     139            } else {
     140                switch_to_blog( $id );
     141            ?>
    139142            <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr( $details->path ) ?>" size="40" style='margin-bottom:5px;' />
    140             <br /><input type="checkbox" style="width:20px;" name="update_home_url" value="update" <?php if ( get_blog_option( $id, 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_blog_option( $id, 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked="checked"'; ?> /> <?php _e( 'Update <code>siteurl</code> and <code>home</code> as well.' ); ?></td>
    141             <?php } ?>
     143            <br /><input type="checkbox" style="width:20px;" name="update_home_url" value="update" <?php if ( get_option( 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_option( 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked="checked"'; ?> /> <?php _e( 'Update <code>siteurl</code> and <code>home</code> as well.' ); ?></td>
     144            <?php
     145                restore_current_blog();
     146            } ?>
    142147        </tr>
    143148        <tr class="form-field">
Note: See TracChangeset for help on using the changeset viewer.