| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\WidgetCreation; |
| 4 |
|
| 5 |
use Elementor\Core\Base\Module as BaseModule; |
| 6 |
use Elementor\Core\Experiments\Manager as ExperimentsManager; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
class Module extends BaseModule { |
| 13 |
const MODULE_NAME = 'widget-creation'; |
| 14 |
const EXPERIMENT_NAME = 'e_widget_creation'; |
| 15 |
|
| 16 |
const PACKAGES = [ |
| 17 |
'editor-widget-creation', |
| 18 |
]; |
| 19 |
|
| 20 |
public function get_name() { |
| 21 |
return self::MODULE_NAME; |
| 22 |
} |
| 23 |
|
| 24 |
public static function get_experimental_data(): array { |
| 25 |
return [ |
| 26 |
'name' => self::EXPERIMENT_NAME, |
| 27 |
'title' => esc_html__( 'Widget Creation', 'elementor' ), |
| 28 |
'description' => esc_html__( 'Promote widget creation with Angie plugin.', 'elementor' ), |
| 29 |
'hidden' => true, |
| 30 |
'default' => ExperimentsManager::STATE_ACTIVE, |
| 31 |
'release_status' => ExperimentsManager::RELEASE_STATUS_ALPHA, |
| 32 |
]; |
| 33 |
} |
| 34 |
|
| 35 |
public function __construct() { |
| 36 |
parent::__construct(); |
| 37 |
|
| 38 |
add_filter( 'elementor/editor/v2/packages', fn( $packages ) => $this->add_packages( $packages ) ); |
| 39 |
} |
| 40 |
|
| 41 |
private function add_packages( array $packages ): array { |
| 42 |
return array_merge( $packages, self::PACKAGES ); |
| 43 |
} |
| 44 |
} |
| 45 |
|