| @@ -4,9 +4,8 @@ | ||
| 4 | 4 | |
| 5 | 5 | use Elementor\Api; |
| 6 | 6 | use Elementor\Controls_Manager; |
| 7 | 7 | use Elementor\Core\Base\Module as Base_Module; |
| 8 | -use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager; | |
| 9 | 8 | use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Custom_Code_Menu; |
| 10 | 9 | use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Custom_Elements_Menu; |
| 11 | 10 | use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Fonts_Menu; |
| 12 | 11 | use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Icons_Menu; |
| @@ -13,20 +12,17 @@ | ||
| 13 | 12 | use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Popups_Menu; |
| 14 | 13 | use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Submissions_Menu; |
| 15 | 14 | use Elementor\Modules\Promotions\AdminMenuItems\Go_Pro_Promotion_Item; |
| 16 | 15 | use Elementor\Modules\Promotions\Controls\Atomic_Promotion_Control; |
| 17 | -use Elementor\Modules\Promotions\Conversion_Banner; | |
| 18 | 16 | use Elementor\Modules\Promotions\Pointers\Birthday; |
| 19 | 17 | use Elementor\Modules\Promotions\Pointers\Black_Friday; |
| 20 | 18 | use Elementor\Modules\Promotions\PropTypes\Promotion_Prop_Type; |
| 21 | 19 | use Elementor\Modules\Promotions\Widgets\Ally_Dashboard_Widget; |
| 22 | 20 | use Elementor\Modules\Promotions\Widgets\Atomic_Form_Widget_Promotion; |
| 23 | -use Elementor\Modules\Promotions\Widgets\Birthday_Easter_Egg_Promotion; | |
| 24 | 21 | use Elementor\Widgets_Manager; |
| 25 | 22 | use Elementor\Utils; |
| 26 | 23 | use Elementor\Includes\EditorAssetsAPI; |
| 27 | 24 | use Elementor\Plugin; |
| 28 | -use Elementor\Modules\EditorOne\Classes\Menu_Config; | |
| 29 | 25 | use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider; |
| 30 | 26 | |
| 31 | 27 | if ( ! defined( 'ABSPATH' ) ) { |
| 32 | 28 | exit; // Exit if accessed directly. |
| @@ -56,12 +52,8 @@ | ||
| 56 | 52 | add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) { |
| 57 | 53 | $this->register_editor_one_menu_items( $menu_data_provider ); |
| 58 | 54 | } ); |
| 59 | 55 | |
| 60 | - if ( Utils::is_sale_time() ) { | |
| 61 | - add_filter( 'add_menu_classes', [ $this, 'override_one_menu_upgrade_label_during_sale' ] ); | |
| 62 | - } | |
| 63 | - | |
| 64 | 56 | add_action( 'elementor/widgets/register', function( Widgets_Manager $manager ) { |
| 65 | 57 | foreach ( Api::get_promotion_widgets() as $widget_data ) { |
| 66 | 58 | $manager->register( new Widgets\Pro_Widget_Promotion( [], [ |
| 67 | 59 | 'widget_name' => $widget_data['name'], |
| @@ -77,12 +69,8 @@ | ||
| 77 | 69 | if ( Black_Friday::should_display_notice() ) { |
| 78 | 70 | new Black_Friday(); |
| 79 | 71 | } |
| 80 | 72 | |
| 81 | - if ( Conversion_Banner::should_display_banner() ) { | |
| 82 | - new Conversion_Banner(); | |
| 83 | - } | |
| 84 | - | |
| 85 | 73 | add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] ); |
| 86 | 74 | |
| 87 | 75 | if ( Utils::has_pro() ) { |
| 88 | 76 | return; |
| @@ -87,10 +75,8 @@ | ||
| 87 | 75 | if ( Utils::has_pro() ) { |
| 88 | 76 | return; |
| 89 | 77 | } |
| 90 | 78 | |
| 91 | - add_filter( 'elementor/editor/localize_settings', [ $this, 'add_editing_panel_sticky_promotion' ] ); | |
| 92 | - | |
| 93 | 79 | add_action( 'elementor/controls/register', function ( Controls_Manager $controls_manager ) { |
| 94 | 80 | $controls_manager->register( new Controls\Promotion_Control() ); |
| 95 | 81 | } ); |
| 96 | 82 | |
| @@ -123,28 +109,8 @@ | ||
| 123 | 109 | die; |
| 124 | 110 | } |
| 125 | 111 | } |
| 126 | 112 | |
| 127 | - public function override_one_menu_upgrade_label_during_sale( $menu ) { | |
| 128 | - global $submenu; | |
| 129 | - | |
| 130 | - $parent_slug = Menu_Config::ELEMENTOR_HOME_MENU_SLUG; | |
| 131 | - $upgrade_slug = 'elementor-one-upgrade'; | |
| 132 | - | |
| 133 | - if ( empty( $submenu[ $parent_slug ] ) ) { | |
| 134 | - return $menu; | |
| 135 | - } | |
| 136 | - | |
| 137 | - foreach ( $submenu[ $parent_slug ] as &$item ) { | |
| 138 | - if ( isset( $item[2] ) && $upgrade_slug === $item[2] ) { | |
| 139 | - $item[0] = esc_html__( 'Sale!', 'elementor' ) . '<br />' . esc_html__( 'Upgrade Now', 'elementor' ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited | |
| 140 | - break; | |
| 141 | - } | |
| 142 | - } | |
| 143 | - | |
| 144 | - return $menu; | |
| 145 | - } | |
| 146 | - | |
| 147 | 113 | private function register_editor_one_menu_items( Menu_Data_Provider $menu_data_provider ) { |
| 148 | 114 | $menu_data_provider->register_menu( new Editor_One_Custom_Elements_Menu() ); |
| 149 | 115 | $menu_data_provider->register_menu( new Editor_One_Submissions_Menu() ); |
| 150 | 116 | $menu_data_provider->register_menu( new Editor_One_Fonts_Menu() ); |
| @@ -168,9 +134,8 @@ | ||
| 168 | 134 | 'react-dom', |
| 169 | 135 | 'backbone-marionette', |
| 170 | 136 | 'elementor-editor-modules', |
| 171 | 137 | 'elementor-v2-ui', |
| 172 | - 'elementor-v2-icons', | |
| 173 | 138 | ], |
| 174 | 139 | ELEMENTOR_VERSION, |
| 175 | 140 | true |
| 176 | 141 | ); |
| @@ -219,18 +184,8 @@ | ||
| 219 | 184 | EditorAssetsAPI::ASSETS_DATA_KEY => 'free-to-pro-upsell', |
| 220 | 185 | ]; |
| 221 | 186 | } |
| 222 | 187 | |
| 223 | - public function add_editing_panel_sticky_promotion( array $settings ): array { | |
| 224 | - if ( ! Plugin::$instance->experiments->is_feature_active( 'e_panel_promotions' ) ) { | |
| 225 | - return $settings; | |
| 226 | - } | |
| 227 | - | |
| 228 | - $settings['editingPanelStickyPromotion'] = Filtered_Promotions_Manager::get_editor_panel_sticky_promotion(); | |
| 229 | - | |
| 230 | - return $settings; | |
| 231 | - } | |
| 232 | - | |
| 233 | 188 | public function add_v4_promotions_data( array $settings ): array { |
| 234 | 189 | if ( ! current_user_can( 'manage_options' ) ) { |
| 235 | 190 | return $settings; |
| 236 | 191 | } |
| @@ -290,10 +245,8 @@ | ||
| 290 | 245 | $config['priority'], |
| 291 | 246 | 2 |
| 292 | 247 | ); |
| 293 | 248 | } |
| 294 | - | |
| 295 | - ( new Birthday_Easter_Egg_Promotion() )->register(); | |
| 296 | 249 | } ); |
| 297 | 250 | |
| 298 | 251 | ( new Atomic_Form_Widget_Promotion() )->register(); |
| 299 | 252 | } |