Make WordPress Core


Ignore:
Timestamp:
09/02/2014 07:29:47 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Simplify the code for calling refresh_blog_details() whenever 'blogname', 'siteurl', or 'post_count' option is updated.

props pento, nacin.
fixes #26410.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-blogs.php

    r29667 r29668  
    236236 * @since MU
    237237 *
    238  * @param int $blog_id Blog ID
    239  */
    240 function refresh_blog_details( $blog_id ) {
     238 * @param int $blog_id Optional. Blog ID. Defaults to current blog.
     239 */
     240function refresh_blog_details( $blog_id = 0 ) {
    241241    $blog_id = (int) $blog_id;
     242    if ( ! $blog_id ) {
     243        $blog_id = get_current_blog_id();
     244    }
     245
    242246    $details = get_blog_details( $blog_id, false );
    243247    if ( ! $details ) {
     
    262266     */
    263267    do_action( 'refresh_blog_details', $blog_id );
    264 }
    265 
    266 /**
    267  * Refresh blog details when an option is updated.
    268  *
    269  * @access private
    270  * @param string $option_name
    271  */
    272 function _wp_refresh_blog_details_on_updated_option( $option_name ) {
    273     $options = array( 'blogname', 'siteurl', 'post_count' );
    274     if ( in_array( $option_name, $options ) ) {
    275         refresh_blog_details( get_current_blog_id() );
    276     }
    277268}
    278269
Note: See TracChangeset for help on using the changeset viewer.