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

props pento, nacin.
fixes #26410.

git-svn-id: https://develop.svn.wordpress.org/trunk@29668 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2014-09-02 07:29:47 +00:00
parent 52dacfd3a5
commit fb8548fd48
2 changed files with 9 additions and 16 deletions
+6 -15
View File
@@ -235,10 +235,14 @@ function get_blog_details( $fields = null, $get_all = true ) {
*
* @since MU
*
* @param int $blog_id Blog ID
* @param int $blog_id Optional. Blog ID. Defaults to current blog.
*/
function refresh_blog_details( $blog_id ) {
function refresh_blog_details( $blog_id = 0 ) {
$blog_id = (int) $blog_id;
if ( ! $blog_id ) {
$blog_id = get_current_blog_id();
}
$details = get_blog_details( $blog_id, false );
if ( ! $details ) {
// Make sure clean_blog_cache() gets the blog ID
@@ -263,19 +267,6 @@ function refresh_blog_details( $blog_id ) {
do_action( 'refresh_blog_details', $blog_id );
}
/**
* Refresh blog details when an option is updated.
*
* @access private
* @param string $option_name
*/
function _wp_refresh_blog_details_on_updated_option( $option_name ) {
$options = array( 'blogname', 'siteurl', 'post_count' );
if ( in_array( $option_name, $options ) ) {
refresh_blog_details( get_current_blog_id() );
}
}
/**
* Update the details for a blog. Updates the blogs table for a given blog id.
*