<?php

/**
 * Fired when the plugin is uninstalled.
 *
 * @since      1.0.0
 *
 * @package    Captain Widgets Kit
 */

// If uninstall not called from WordPress, then exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;
}

$get_setting = get_option( 'captwiki_settings', false );

if ( ! empty( $get_setting['cleanup_db'] ) && true == $get_setting['cleanup_db'] ) {
    delete_option( 'captwiki_settings' );

    // Remove onboarding dismissed flag from all users.
    delete_metadata( 'user', 0, 'captwiki_onboarding_dismissed', '', true );
}
