/** * Runs the uninstall method for each site on the network. * * @since 1.0 * @return void */ public static function uninstall() { global $blog_id; global $wpdb; $original_blog_id = $blog_id; $blog_ids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); foreach ($blog_ids as $id) { switch_to_blog($id); FLBuilderAdmin::uninstall(); } switch_to_blog($original_blog_id); }
/** * Uninstalls the builder and all of its data. * * @since 1.0 * @access private * @return void */ private static function uninstall() { if (!current_user_can('delete_plugins')) { return; } else { if (isset($_POST['fl-uninstall']) && wp_verify_nonce($_POST['fl-uninstall'], 'uninstall')) { if (is_multisite() && class_exists('FLBuilderMultisite')) { FLBuilderMultisite::uninstall(); } else { FLBuilderAdmin::uninstall(); } } } }