← All changes
|
modules/promotions/admin-menu-items/go-pro-promotion-item.php
+9
-10
4.3.3
→
3.20.2
View file →
| @@ -2,18 +2,17 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Elementor\Modules\Promotions\AdminMenuItems; |
| 4 | 4 | |
| 5 | 5 | use Elementor\Core\Admin\Menu\Interfaces\Admin_Menu_Item_With_Page; |
| 6 | -use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager; | |
| 6 | +use Elementor\Core\Utils\Promotions\Validate_Promotion; | |
| 7 | 7 | use Elementor\Settings; |
| 8 | -use Elementor\Utils; | |
| 9 | 8 | |
| 10 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | - exit; // Exit if accessed directly. | |
| 10 | + exit; // Exit if accessed directly | |
| 12 | 11 | } |
| 13 | 12 | |
| 14 | 13 | class Go_Pro_Promotion_Item implements Admin_Menu_Item_With_Page { |
| 15 | - const URL = 'https://go.elementor.com/go-pro-upgrade-one-wp-menu/'; | |
| 14 | + const URL = 'https://go.elementor.com/pro-admin-menu/'; | |
| 16 | 15 | |
| 17 | 16 | public function get_name() { |
| 18 | 17 | return 'admin_menu_promo'; |
| 19 | 18 | } |
| @@ -28,12 +27,8 @@ | ||
| 28 | 27 | |
| 29 | 28 | public function get_label() { |
| 30 | 29 | $upgrade_text = esc_html__( 'Upgrade', 'elementor' ); |
| 31 | 30 | |
| 32 | - if ( Utils::is_sale_time() ) { | |
| 33 | - $upgrade_text = esc_html__( 'Upgrade Sale Now', 'elementor' ); | |
| 34 | - } | |
| 35 | - | |
| 36 | 31 | return apply_filters( 'elementor/admin_menu/custom_promotion', [ 'upgrade_text' => $upgrade_text ] )['upgrade_text'] ?? $upgrade_text; |
| 37 | 32 | } |
| 38 | 33 | |
| 39 | 34 | public function get_page_title() { |
| @@ -46,10 +41,14 @@ | ||
| 46 | 41 | |
| 47 | 42 | public static function get_url() { |
| 48 | 43 | $url = self::URL; |
| 49 | 44 | $filtered_url = apply_filters( 'elementor/admin_menu/custom_promotion', [ 'upgrade_url' => $url ] )['upgrade_url'] ?? ''; |
| 50 | - $promotion_data = Filtered_Promotions_Manager::get_filtered_promotion_data( [ 'upgrade_url' => $filtered_url ], 'elementor/admin_menu/custom_promotion', 'upgrade_url' ); | |
| 51 | - return $promotion_data ['upgrade_url']; | |
| 45 | + | |
| 46 | + if ( Validate_Promotion::domain_is_on_elementor_dot_com( $filtered_url ) ) { | |
| 47 | + $url = $filtered_url; | |
| 48 | + } | |
| 49 | + | |
| 50 | + return esc_url( $url ); | |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | 53 | public function render() { |
| 55 | 54 | // Redirects from the module on `admin_init`. |