PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.2
Elementor Website Builder – more than just a page builder v4.0.2
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / promotions / admin-menu-items / go-pro-promotion-item.php

go-pro-promotion-item.php in Elementor Website Builder – more than just a page builder 4.0.2, at modules/promotions/admin-menu-items/go-pro-promotion-item.php

59 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\Promotions\AdminMenuItems;
4
5 use Elementor\Core\Admin\Menu\Interfaces\Admin_Menu_Item_With_Page;
6 use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
7 use Elementor\Settings;
8 use Elementor\Utils;
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit; // Exit if accessed directly.
12 }
13
14 class Go_Pro_Promotion_Item implements Admin_Menu_Item_With_Page {
15 const URL = 'https://go.elementor.com/pro-admin-menu/';
16
17 public function get_name() {
18 return 'admin_menu_promo';
19 }
20
21 public function is_visible() {
22 return true;
23 }
24
25 public function get_parent_slug() {
26 return Settings::PAGE_ID;
27 }
28
29 public function get_label() {
30 $upgrade_text = esc_html__( 'Upgrade', 'elementor' );
31
32 if ( Utils::is_sale_time() ) {
33 $upgrade_text = esc_html__( 'Upgrade Sale Now', 'elementor' );
34 }
35
36 return apply_filters( 'elementor/admin_menu/custom_promotion', [ 'upgrade_text' => $upgrade_text ] )['upgrade_text'] ?? $upgrade_text;
37 }
38
39 public function get_page_title() {
40 return '';
41 }
42
43 public function get_capability() {
44 return 'manage_options';
45 }
46
47 public static function get_url() {
48 $url = self::URL;
49 $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'];
52 }
53
54 public function render() {
55 // Redirects from the module on `admin_init`.
56 die;
57 }
58 }
59