WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin\API

Notes::is_tasklist_experiment_assigned_treatment() private WC 1.0

Checks if user is in tasklist experiment.

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

No Hooks.

Return

true|false. Whether remote inbox notifications are enabled.

Usage

// private - for code of main (parent) class only
$result = $this->is_tasklist_experiment_assigned_treatment();

Code of Notes::is_tasklist_experiment_assigned_treatment() WC 6.1.1

private function is_tasklist_experiment_assigned_treatment() {
	$anon_id        = isset( $_COOKIE['tk_ai'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['tk_ai'] ) ) : '';
	$allow_tracking = 'yes' === get_option( 'woocommerce_allow_tracking' );
	$abtest         = new \WooCommerce\Admin\Experimental_Abtest(
		$anon_id,
		'woocommerce',
		$allow_tracking
	);

	$date = new \DateTime();
	$date->setTimeZone( new \DateTimeZone( 'UTC' ) );

	$experiment_name = sprintf(
		'woocommerce_tasklist_progression_headercard_%s_%s',
		$date->format( 'Y' ),
		$date->format( 'm' )
	);

	$experiment_name_2col = sprintf(
		'woocommerce_tasklist_progression_headercard_2col_%s_%s',
		$date->format( 'Y' ),
		$date->format( 'm' )
	);

	return $abtest->get_variation( $experiment_name ) === 'treatment' ||
		$abtest->get_variation( $experiment_name_2col ) === 'treatment';
}