blog_id ); try { self::install(); } finally { restore_current_blog(); } } /** * Add this plugin's tables to the list core drops when a site is deleted. * * @param string[] $tables Tables core will drop. * @param int $blog_id Site being deleted. * @return string[] */ public static function drop_tables( $tables, $blog_id = 0 ) { return array_values( array_unique( array_merge( (array) $tables, Database::tables( (int) $blog_id ) ) ) ); } /** * Write the marker (new sites only) and run the migrations, for the current site. * * @return void */ private static function install() { Install_Marker::maybe_write(); Migrations::maybe_run(); } /** * Whether the plugin is network-active. * * @return bool */ private static function is_network_active() { if ( ! is_multisite() ) { return false; } if ( ! function_exists( 'is_plugin_active_for_network' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } return is_plugin_active_for_network( plugin_basename( FORMWRIGHT_FILE ) ); } }