• LifterLMS
  • Knowledge Base
  • Academy
  • Blog
  • Podcast
  • Contributors
  • My Account

LifterLMS LifterLMS

  • Code Reference
  • REST API
  • LLMS-CLI

Code Reference

Skip to content
Filter by type:
Search
Browse: Home / Code Reference / Classes / LLMS_Admin_Tool_Wipe_Legacy_Account_Options / LLMS_Admin_Tool_Wipe_Legacy_Account_Options::handle()

LLMS_Admin_Tool_Wipe_Legacy_Account_Options::handle()

Process the tool.

Contents

  • Description
  • Return
  • Source
  • Changelog
  • User Contributed Notes

Description #Description

Deletes all core reusable blocks and then recreates the core forms, which additionally recreates the core reusable blocks.


Top ↑

Return #Return

(boolean)


Top ↑

Source #Source

File: includes/admin/tools/class-llms-admin-tool-wipe-legacy-account-options.php

	protected function handle() {

		$options_to_wipe = array(
			'lifterlms_registration_generate_username',
			'lifterlms_registration_password_strength',
			'lifterlms_registration_password_min_strength',
			'lifterlms_user_info_field_names_checkout_visibility',
			'lifterlms_user_info_field_address_checkout_visibility',
			'lifterlms_user_info_field_phone_checkout_visibility',
			'lifterlms_user_info_field_email_confirmation_checkout_visibility',
			'lifterlms_user_info_field_names_registration_visibility',
			'lifterlms_user_info_field_address_registration_visibility',
			'lifterlms_user_info_field_phone_registration_visibility',
			'lifterlms_user_info_field_email_confirmation_registration_visibility',
			'lifterlms_voucher_field_registration_visibility',
			'lifterlms_user_info_field_names_account_visibility',
			'lifterlms_user_info_field_address_account_visibility',
			'lifterlms_user_info_field_phone_account_visibility',
			'lifterlms_user_info_field_email_confirmation_account_visibility',
		);

		global $wpdb;

		$sql = "
		DELETE FROM {$wpdb->options}
		WHERE option_name IN (" . implode( ', ', array_fill( 0, count( $options_to_wipe ), '%s' ) ) . ')';

		$wpdb->query(
			$wpdb->prepare(
				$sql,  // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
				$options_to_wipe
			)
		); // db call ok; no-cache ok.

		$this->skip_cache = true;

		return true;

	}

Expand full source code Collapse full source code View on GitHub


Top ↑

Changelog #Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

© 2014 - 2023 LifterLMS · Privacy Policy · Terms and Conditions

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.