'post_chooser', 'layout' => 'inline', 'postChooserOptions' => ['multiple' => false, 'showThumbnails' => false, 'postType' => 'abst_experiments']], ), // Stored as 'original' or 'variation' and output as the bt-variation attribute. control('test_var_name', __( 'Version', 'ab-split-test-lite' ), ['type' => 'dropdown', 'layout' => 'inline', 'items' => array_map( function ( $value, $label ) { return [ 'value' => $value, 'text' => $label ]; }, array_keys( abst_onpage_variation_choices() ), array_values( abst_onpage_variation_choices() ) )], ), // Opens the create-test pop-up (js/builderhelper.js); the new test can then be // picked in Split Test above. control('test_create', 'New Test', ['type' => 'alert_box', 'layout' => 'vertical', 'alertBoxOptions' => [ 'style' => 'info', 'content' => '+ ' . esc_html__( 'Create a new test', 'ab-split-test-lite' ) . '', ]], ), ], ['isExternal' => true] ); return $controls; } add_filter('breakdance_element_attributes', 'abst_bd_attributes', 100, 1); /** * @param ElementAttribute[] $attributes * * @return array */ function abst_bd_attributes($attributes) { $attributes[] = [ "name" => "bt-eid", "propertyPath" => "settings.abtest.test_name", ]; $attributes[] = [ "name" => "bt-variation", "propertyPath" => "settings.abtest.test_var_name", ]; return $attributes; }