static function run_installer() { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { // check if it is a network activation - if so, run the activation function for each blog id if (isset($_GET['networkwide']) && $_GET['networkwide'] == 1) { $old_blog = $wpdb->blogid; // Get all blog ids $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); AIOWPSecurity_Installer::create_db_tables(); AIOWPSecurity_Configure_Settings::add_option_values(); } AIOWPSecurity_Installer::create_db_backup_dir(); //Create a backup dir in the WP uploads directory switch_to_blog($old_blog); return; } } AIOWPSecurity_Installer::create_db_tables(); AIOWPSecurity_Configure_Settings::add_option_values(); AIOWPSecurity_Installer::create_db_backup_dir(); //Create a backup dir in the WP uploads directory AIOWPSecurity_Installer::miscellaneous_tasks(); }
function aiowps_ms_handle_new_blog_creation($blog_id, $user_id, $domain, $path, $site_id, $meta) { global $wpdb; if (is_plugin_active_for_network(__FILE__)) { if (!class_exists('AIOWPSecurity_Installer')) { include_once 'classes/wp-security-installer.php'; } $old_blog = $wpdb->blogid; switch_to_blog($blog_id); AIOWPSecurity_Installer::create_db_tables(); switch_to_blog($old_blog); } }