automattic/jetpack-abtest

Provides an interface to the WP.com A/B tests.

v1.1.0 2020-03-31 14:56 UTC

This package is auto-updated.

Last update: 2020-03-31 14:56:33 UTC


README

Provides an interface to the WP.com A/B tests.

Used to retrieve the variation of a valid, active A/B test running on WP.com for the current user.

Usage

Retrieve the A/B test variation of the current user for the example_abtest_name A/B test:

use Automattic\Jetpack\Abtest;

$abtest = new Abtest();
$variation = $abtest->get_variation( 'example_abtest_name' );

Will return null if the A/B test is invalid or is currently inactive.