Automattic\WooCommerce\Admin\Features\OnboardingTasks

DeprecatedOptions::update_deprecated_options()public staticWC 1.0

Updates the new option names when deprecated options are updated. This is a temporary fallback until we can fully remove the old task list components.

Method of the class: DeprecatedOptions{}

No Hooks.

Return

String.

Usage

$result = DeprecatedOptions::update_deprecated_options( $value, $old_value, $option );
$value(string) (required)
New value.
$old_value(string) (required)
Old value.
$option(string) (required)
Option name.

DeprecatedOptions::update_deprecated_options() code WC 8.7.0

public static function update_deprecated_options( $value, $old_value, $option ) {
	switch ( $option ) {
		case 'woocommerce_task_list_hidden':
			$task_list = TaskLists::get_list( 'setup' );
			if ( ! $task_list ) {
				return;
			}
			$update = 'yes' === $value ? $task_list->hide() : $task_list->unhide();
			delete_option( 'woocommerce_task_list_hidden' );
			return false;
		case 'woocommerce_extended_task_list_hidden':
			$task_list = TaskLists::get_list( 'extended' );
			if ( ! $task_list ) {
				return;
			}
			$update = 'yes' === $value ? $task_list->hide() : $task_list->unhide();
			delete_option( 'woocommerce_extended_task_list_hidden' );
			return false;
	}
}