Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Purchase::clear_dismissal()publicWC 1.0

Clear dismissal on onboarding product type changes.

{} It's a method of the class: Purchase{}

No Hooks.

Return

null. Nothing.

Usage

$Purchase = new Purchase();
$Purchase->clear_dismissal( $old_value, $new_value );
$old_value(array) (required)
Old value.
$new_value(array) (required)
New value.

Code of Purchase::clear_dismissal() WC 6.7.0

public function clear_dismissal( $old_value, $new_value ) {
	$product_types          = isset( $new_value['product_types'] ) ? (array) $new_value['product_types'] : array();
	$previous_product_types = isset( $old_value['product_types'] ) ? (array) $old_value['product_types'] : array();

	if ( empty( array_diff( $product_types, $previous_product_types ) ) ) {
		return;
	}

	$this->undo_dismiss();
}