Elementor Experiments

Introduction

Elementor v3.1.0 introduces a new way to handle features that are during their experimental phase.

Each experimental feature has several properties that represent different aspects of the feature:

Feature Properties

Property DefaultPossible Values
name : string
The name of the feature
N/Afeature_name_slug
title : string
The title that will be shown in the Experiments Dashboard
N/AFree text
description : string
The description that will be shown in the Experiments Dashboard
Empty stringFree text
release_status : string
Status of the release that will be shown in the Experiments Dashboard
Experiments\Manager::RELEASE_STATUS_ALPHAOne of Experiments\Manager statuses*
state : string
Read-only. The state of the feature defined by the user in the dashboard
Experiments\Manager::STATE_DEFAULTOne of Experiments\Manager states**
default : string
The default state of the feature, as long as the user has not changed it
Experiments\Manager::STATE_INACTIVEOne of Experiments\Manager states**
on_state_change : callback 
Callback to run when the feature state has been changed by the user
nullA callback

* Experiments\Manager statuses are:

  • Experiments\Manager::RELEASE_STATUS_DEV
  • Experiments\Manager::RELEASE_STATUS_ALPHA
  • Experiments\Manager::RELEASE_STATUS_BETA
  • Experiments\Manager::RELEASE_STATUS_RC
  • Experiments\Manager::RELEASE_STATUS_STABLE

** Experiments\Manager states are:

  • Experiments\Manager::STATE_DEFAULT
  • Experiments\Manager::STATE_ACTIVE
  • Experiments\Manager::STATE_INACTIVE

The full Experiments\Manager class name is Elementor\Core\Experiments\Manager.

Registering a feature

You can add your feature by listening to elementor/experiments/default-features-registered hook:

use Elementor\Core\Experiments\Manager as Experiments_Manager;

add_action( 'elementor/experiments/default-features-registered', function( Experiments_Manager $experiments_manager ) {
	$experiments_manager->add_feature( [
		'name' => 'my-feature',
		'title' => 'My Feature',
		'description' => 'This is an experimental feature. Use it if you dare!',
		'release_status' => Experiments_Manager::RELEASE_STATUS_BETA,
		'default' => Experiments_Manager::STATE_ACTIVE,
	] );
} );

Now you will be able to see your feature in the Experiments dashboard: