register(); $erase = (bool) get_option( Settings::SETTING_NAME_DATA_REMOVAL ); /** * Filters whether data should be erased when uninstalling the plugin. * * @since 1.0.0 * * @param bool $erase Whether to erase data. Default false. */ $erase = (bool) apply_filters( 'web_stories_erase_data_on_uninstall', $erase ); if ( false === $erase ) { return; } /** * Defer running uninstall until every service is registered. * * @since 1.26.0 */ function web_stories_uninstall(): void { $ws_plugin = PluginFactory::create(); $ws_plugin->register(); $ws_plugin->on_site_uninstall(); } add_action( 'shutdown', 'web_stories_uninstall' );