10 * @package WordPress |
10 * @package WordPress |
11 * @subpackage Multisite |
11 * @subpackage Multisite |
12 * @see default-filters.php |
12 * @see default-filters.php |
13 * @since 3.0.0 |
13 * @since 3.0.0 |
14 */ |
14 */ |
|
15 |
|
16 // Functions |
|
17 add_action( 'update_option_blog_public', 'update_blog_public', 10, 2 ); |
|
18 add_filter( 'option_users_can_register', 'users_can_register_signup_filter' ); |
|
19 add_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' ); |
15 |
20 |
16 // Users |
21 // Users |
17 add_filter( 'wpmu_validate_user_signup', 'signup_nonce_check' ); |
22 add_filter( 'wpmu_validate_user_signup', 'signup_nonce_check' ); |
18 add_action( 'init', 'maybe_add_existing_user_to_blog' ); |
23 add_action( 'init', 'maybe_add_existing_user_to_blog' ); |
19 add_action( 'wpmu_new_user', 'newuser_notify_siteadmin' ); |
24 add_action( 'wpmu_new_user', 'newuser_notify_siteadmin' ); |
32 add_action( 'template_redirect', 'maybe_redirect_404' ); |
37 add_action( 'template_redirect', 'maybe_redirect_404' ); |
33 add_filter( 'allowed_redirect_hosts', 'redirect_this_site' ); |
38 add_filter( 'allowed_redirect_hosts', 'redirect_this_site' ); |
34 |
39 |
35 // Administration |
40 // Administration |
36 add_filter( 'term_id_filter', 'global_terms', 10, 2 ); |
41 add_filter( 'term_id_filter', 'global_terms', 10, 2 ); |
37 add_action( 'publish_post', 'update_posts_count' ); |
42 add_action( 'delete_post', '_update_posts_count_on_delete' ); |
38 add_action( 'delete_post', '_update_blog_date_on_post_delete' ); |
43 add_action( 'delete_post', '_update_blog_date_on_post_delete' ); |
39 add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 ); |
44 add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 ); |
|
45 add_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10, 2 ); |
40 |
46 |
41 // Counts |
47 // Counts |
42 add_action( 'admin_init', 'wp_schedule_update_network_counts'); |
48 add_action( 'admin_init', 'wp_schedule_update_network_counts'); |
43 add_action( 'update_network_counts', 'wp_update_network_counts'); |
49 add_action( 'update_network_counts', 'wp_update_network_counts'); |
44 foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) |
50 foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) |
67 |
73 |
68 // WP_HOME and WP_SITEURL should not have any effect in MS |
74 // WP_HOME and WP_SITEURL should not have any effect in MS |
69 remove_filter( 'option_siteurl', '_config_wp_siteurl' ); |
75 remove_filter( 'option_siteurl', '_config_wp_siteurl' ); |
70 remove_filter( 'option_home', '_config_wp_home' ); |
76 remove_filter( 'option_home', '_config_wp_home' ); |
71 |
77 |
|
78 // Some options changes should trigger blog details refresh. |
|
79 add_action( 'update_option_blogname', 'refresh_blog_details', 10, 0 ); |
|
80 add_action( 'update_option_siteurl', 'refresh_blog_details', 10, 0 ); |
|
81 add_action( 'update_option_post_count', 'refresh_blog_details', 10, 0 ); |
|
82 |
72 // If the network upgrade hasn't run yet, assume ms-files.php rewriting is used. |
83 // If the network upgrade hasn't run yet, assume ms-files.php rewriting is used. |
73 add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); |
84 add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); |
74 |
85 |
75 // Whitelist multisite domains for HTTP requests |
86 // Whitelist multisite domains for HTTP requests |
76 add_filter( 'http_request_host_is_external', 'ms_allowed_http_request_hosts', 20, 2 ); |
87 add_filter( 'http_request_host_is_external', 'ms_allowed_http_request_hosts', 20, 2 ); |