X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..caeaf8dc94b5e3f75dc98ec92dc7b76049cdddb6:/wp-includes/ms-default-filters.php diff --git a/wp-includes/ms-default-filters.php b/wp-includes/ms-default-filters.php index c4c223a4..7481ec9a 100644 --- a/wp-includes/ms-default-filters.php +++ b/wp-includes/ms-default-filters.php @@ -18,7 +18,7 @@ add_filter( 'wpmu_validate_user_signup', 'signup_nonce_check' ); add_action( 'init', 'maybe_add_existing_user_to_blog' ); add_action( 'wpmu_new_user', 'newuser_notify_siteadmin' ); add_action( 'wpmu_activate_user', 'add_new_user_to_blog', 10, 3 ); -add_action( 'sanitize_user', 'strtolower' ); +add_filter( 'sanitize_user', 'strtolower' ); // Blogs add_filter( 'wpmu_validate_blog_signup', 'signup_nonce_check' ); @@ -34,11 +34,19 @@ add_filter( 'allowed_redirect_hosts', 'redirect_this_site' ); // 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'); add_action( 'update_network_counts', 'wp_update_network_counts'); +foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) + add_action( $action, 'wp_maybe_update_network_user_counts' ); +foreach ( array( 'make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog' ) as $action ) + add_action( $action, 'wp_maybe_update_network_site_counts' ); +unset( $action ); // Files add_filter( 'wp_upload_bits', 'upload_is_file_too_big' ); @@ -62,6 +70,11 @@ add_filter( 'force_filtered_html_on_import', '__return_true' ); 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' );