Ticket #26410: 26410.3.diff
File 26410.3.diff, 1.9 KB (added by , 10 years ago) |
---|
-
src/wp-includes/ms-blogs.php
235 235 * 236 236 * @since MU 237 237 * 238 * @param int $blog_id Blog ID238 * @param int $blog_id Optional. Blog ID. Defaults to current blog. 239 239 */ 240 function refresh_blog_details( $blog_id ) {240 function refresh_blog_details( $blog_id = 0 ) { 241 241 $blog_id = (int) $blog_id; 242 if ( ! $blog_id ) { 243 $blog_id = get_current_blog_id(); 244 } 242 245 $details = get_blog_details( $blog_id, false ); 243 246 if ( ! $details ) { 244 247 // Make sure clean_blog_cache() gets the blog ID … … 264 267 } 265 268 266 269 /** 267 * Refresh blog details when an option is updated.268 *269 * @access private270 * @param string $option_name271 */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 }277 }278 279 /**280 270 * Update the details for a blog. Updates the blogs table for a given blog id. 281 271 * 282 272 * @since MU -
src/wp-includes/ms-default-filters.php
71 71 remove_filter( 'option_home', '_config_wp_home' ); 72 72 73 73 // Some options changes should trigger blog details refresh. 74 add_action( 'updated_option', '_wp_refresh_blog_details_on_updated_option' ); 74 add_action( 'update_option_blogname', 'refresh_blog_details', 10, 0 ); 75 add_action( 'update_option_siteurl', 'refresh_blog_details', 10, 0 ); 76 add_action( 'update_option_post_count', 'refresh_blog_details', 10, 0 ); 75 77 76 78 // If the network upgrade hasn't run yet, assume ms-files.php rewriting is used. 77 79 add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );