| @@ -12,20 +12,17 @@ | ||
| 12 | 12 | use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Popups_Menu; |
| 13 | 13 | use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Submissions_Menu; |
| 14 | 14 | use Elementor\Modules\Promotions\AdminMenuItems\Go_Pro_Promotion_Item; |
| 15 | 15 | use Elementor\Modules\Promotions\Controls\Atomic_Promotion_Control; |
| 16 | -use Elementor\Modules\Promotions\Conversion_Banner; | |
| 17 | 16 | use Elementor\Modules\Promotions\Pointers\Birthday; |
| 18 | 17 | use Elementor\Modules\Promotions\Pointers\Black_Friday; |
| 19 | 18 | use Elementor\Modules\Promotions\PropTypes\Promotion_Prop_Type; |
| 20 | 19 | use Elementor\Modules\Promotions\Widgets\Ally_Dashboard_Widget; |
| 21 | 20 | use Elementor\Modules\Promotions\Widgets\Atomic_Form_Widget_Promotion; |
| 22 | -use Elementor\Modules\Promotions\Widgets\Birthday_Easter_Egg_Promotion; | |
| 23 | 21 | use Elementor\Widgets_Manager; |
| 24 | 22 | use Elementor\Utils; |
| 25 | 23 | use Elementor\Includes\EditorAssetsAPI; |
| 26 | 24 | use Elementor\Plugin; |
| 27 | -use Elementor\Modules\EditorOne\Classes\Menu_Config; | |
| 28 | 25 | use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider; |
| 29 | 26 | |
| 30 | 27 | if ( ! defined( 'ABSPATH' ) ) { |
| 31 | 28 | exit; // Exit if accessed directly. |
| @@ -55,12 +52,8 @@ | ||
| 55 | 52 | add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) { |
| 56 | 53 | $this->register_editor_one_menu_items( $menu_data_provider ); |
| 57 | 54 | } ); |
| 58 | 55 | |
| 59 | - if ( Utils::is_sale_time() ) { | |
| 60 | - add_filter( 'add_menu_classes', [ $this, 'override_one_menu_upgrade_label_during_sale' ] ); | |
| 61 | - } | |
| 62 | - | |
| 63 | 56 | add_action( 'elementor/widgets/register', function( Widgets_Manager $manager ) { |
| 64 | 57 | foreach ( Api::get_promotion_widgets() as $widget_data ) { |
| 65 | 58 | $manager->register( new Widgets\Pro_Widget_Promotion( [], [ |
| 66 | 59 | 'widget_name' => $widget_data['name'], |
| @@ -76,14 +69,8 @@ | ||
| 76 | 69 | if ( Black_Friday::should_display_notice() ) { |
| 77 | 70 | new Black_Friday(); |
| 78 | 71 | } |
| 79 | 72 | |
| 80 | - if ( Conversion_Banner::should_display_banner() ) { | |
| 81 | - new Conversion_Banner(); | |
| 82 | - } | |
| 83 | - | |
| 84 | - add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] ); | |
| 85 | - | |
| 86 | 73 | if ( Utils::has_pro() ) { |
| 87 | 74 | return; |
| 88 | 75 | } |
| 89 | 76 | |
| @@ -92,8 +79,9 @@ | ||
| 92 | 79 | } ); |
| 93 | 80 | |
| 94 | 81 | add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_react_data' ] ); |
| 95 | 82 | add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_v4_alphachip' ] ); |
| 83 | + add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] ); | |
| 96 | 84 | |
| 97 | 85 | // Add Ally promo |
| 98 | 86 | Ally_Dashboard_Widget::init(); |
| 99 | 87 | |
| @@ -120,28 +108,8 @@ | ||
| 120 | 108 | die; |
| 121 | 109 | } |
| 122 | 110 | } |
| 123 | 111 | |
| 124 | - public function override_one_menu_upgrade_label_during_sale( $menu ) { | |
| 125 | - global $submenu; | |
| 126 | - | |
| 127 | - $parent_slug = Menu_Config::ELEMENTOR_HOME_MENU_SLUG; | |
| 128 | - $upgrade_slug = 'elementor-one-upgrade'; | |
| 129 | - | |
| 130 | - if ( empty( $submenu[ $parent_slug ] ) ) { | |
| 131 | - return $menu; | |
| 132 | - } | |
| 133 | - | |
| 134 | - foreach ( $submenu[ $parent_slug ] as &$item ) { | |
| 135 | - if ( isset( $item[2] ) && $upgrade_slug === $item[2] ) { | |
| 136 | - $item[0] = esc_html__( 'Sale!', 'elementor' ) . '<br />' . esc_html__( 'Upgrade Now', 'elementor' ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited | |
| 137 | - break; | |
| 138 | - } | |
| 139 | - } | |
| 140 | - | |
| 141 | - return $menu; | |
| 142 | - } | |
| 143 | - | |
| 144 | 112 | private function register_editor_one_menu_items( Menu_Data_Provider $menu_data_provider ) { |
| 145 | 113 | $menu_data_provider->register_menu( new Editor_One_Custom_Elements_Menu() ); |
| 146 | 114 | $menu_data_provider->register_menu( new Editor_One_Submissions_Menu() ); |
| 147 | 115 | $menu_data_provider->register_menu( new Editor_One_Fonts_Menu() ); |
| @@ -276,10 +244,8 @@ | ||
| 276 | 244 | $config['priority'], |
| 277 | 245 | 2 |
| 278 | 246 | ); |
| 279 | 247 | } |
| 280 | - | |
| 281 | - ( new Birthday_Easter_Egg_Promotion() )->register(); | |
| 282 | 248 | } ); |
| 283 | 249 | |
| 284 | 250 | ( new Atomic_Form_Widget_Promotion() )->register(); |
| 285 | 251 | } |