// Administration
add_filter( 'term_id_filter', 'global_terms', 10, 2 );
-add_action( 'publish_post', 'update_posts_count' );
+add_action( 'delete_post', '_update_posts_count_on_delete' );
add_action( 'delete_post', '_update_blog_date_on_post_delete' );
add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 );
+add_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10, 2 );
// Counts
add_action( 'admin_init', 'wp_schedule_update_network_counts');
remove_filter( 'option_siteurl', '_config_wp_siteurl' );
remove_filter( 'option_home', '_config_wp_home' );
+// Some options changes should trigger blog details refresh.
+add_action( 'update_option_blogname', 'refresh_blog_details', 10, 0 );
+add_action( 'update_option_siteurl', 'refresh_blog_details', 10, 0 );
+add_action( 'update_option_post_count', 'refresh_blog_details', 10, 0 );
+
// If the network upgrade hasn't run yet, assume ms-files.php rewriting is used.
add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );