Automattic\WooCommerce\Admin\Features\OnboardingTasks
DeprecatedOptions::update_deprecated_options
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.
Returns
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() DeprecatedOptions::update deprecated options code WC 10.4.3
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;
}
}