Ticket #14170: 14170.4.diff
File 14170.4.diff, 2.2 KB (added by , 14 years ago) |
---|
-
wp-includes/ms-default-filters.php
22 22 23 23 // Blogs 24 24 add_filter( 'wpmu_validate_blog_signup', 'signup_nonce_check' ); 25 add_action( 'wpmu_new_blog', 'wpmu_activate_network_plugins', 9 );26 25 add_action( 'wpmu_new_blog', 'wpmu_log_new_registrations', 10, 2 ); 27 26 add_action( 'wpmu_new_blog', 'newblog_notify_siteadmin', 10, 2 ); 28 27 29 28 // Register Nonce 30 29 add_action( 'signup_hidden_fields', 'signup_nonce_fields' ); 31 30 31 // Plugins 32 add_action( 'wpmu_new_blog', 'wpmu_activate_network_plugins', 9 ); 33 add_action( 'activated_plugin', 'wpmu_handle_network_activation', 9 ); 34 add_action( 'deactivated_plugin', 'wpmu_handle_network_activation', 9 ); 35 32 36 // Template 33 37 add_action( 'template_redirect', 'maybe_redirect_404' ); 34 38 add_filter( 'allowed_redirect_hosts', 'redirect_this_site' ); -
wp-includes/ms-functions.php
1244 1244 restore_current_blog(); 1245 1245 } 1246 1246 1247 /** 1248 * Fires the activation hook for each active site in a network 1249 * when a network activation occurs 1250 * 1251 * @since 3.1.0 1252 * 1253 * @param string $plugin The plugin being network-activated 1254 */ 1255 function wpmu_handle_network_activation( $plugin ) { 1256 if ( !is_plugin_active_for_network( $plugin ) ) 1257 return; 1258 1259 global $wpdb; 1260 1261 $active_blogs = $wpdb->get_col( " 1262 SELECT blog_id 1263 FROM $wpdb->blogs 1264 WHERE site_id = '{$wpdb->siteid}' 1265 AND deleted = 0 1266 " ); 1267 1268 list( $action ) = explode( '_', current_filter(), 2 ); 1269 1270 $action = str_replace( 'activated', 'activate', $action ); 1271 1272 foreach ( $active_blogs as $blog_id ) { 1273 switch_to_blog( $blog_id ); 1274 1275 if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) ) 1276 continue; 1277 1278 do_action( $action . '_' . $plugin, false ); 1279 do_action( $action . '_plugin', $plugin, false ); 1280 } 1281 1282 restore_current_blog(); 1283 } 1284 1247 1285 function wpmu_log_new_registrations( $blog_id, $user_id ) { 1248 1286 global $wpdb; 1249 1287 $user = new WP_User( (int) $user_id );