Make WordPress Core


Ignore:
Timestamp:
06/28/2014 04:06:12 AM (11 years ago)
Author:
wonderboymusic
Message:

In multisite, on the updated_option action, if the option name is one of: 'blogname', 'siteurl', 'post_count' - refresh the blog details cache for the current blog id.

Adds unit test.

Props kovshenin.
Fixes #26410.

File:
1 edited

Legend:

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

    r28835 r28881  
    265265
    266266/**
     267 * Refresh blog details when an option is updated.
     268 *
     269 * @access private
     270 * @param string $option_name
     271 */
     272function _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    }
     277}
     278
     279/**
    267280 * Update the details for a blog. Updates the blogs table for a given blog id.
    268281 *
     
    904917        return;
    905918    }
    906    
     919
    907920    update_posts_count();
    908921}
Note: See TracChangeset for help on using the changeset viewer.