| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Promotions\AdminMenuItems; |
| 4 |
|
| 5 |
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface; |
| 6 |
use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager; |
| 7 |
use Elementor\Modules\EditorOne\Classes\Menu_Config; |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
class Editor_One_Popups_Menu extends Base_Promotion_Item implements Menu_Item_Interface { |
| 14 |
|
| 15 |
private array $promotion_data; |
| 16 |
|
| 17 |
public function __construct() { |
| 18 |
$this->promotion_data = [ |
| 19 |
'title' => esc_html__( 'Get Popup Builder', 'elementor' ), |
| 20 |
'content' => esc_html__( |
| 21 |
'The Popup Builder lets you take advantage of all the amazing features in Elementor, so you can build beautiful & highly converting popups. Get Elementor Pro and start designing your popups today.', |
| 22 |
'elementor' |
| 23 |
), |
| 24 |
'action_button' => [ |
| 25 |
'text' => esc_html__( 'Upgrade Now', 'elementor' ), |
| 26 |
'url' => 'https://go.elementor.com/go-pro-popup-builder/', |
| 27 |
], |
| 28 |
]; |
| 29 |
|
| 30 |
$this->promotion_data = Filtered_Promotions_Manager::get_filtered_promotion_data( $this->promotion_data, 'elementor/templates/popup', 'action_button', 'url' ); |
| 31 |
} |
| 32 |
|
| 33 |
public function get_position(): int { |
| 34 |
return 50; |
| 35 |
} |
| 36 |
|
| 37 |
public function get_slug(): string { |
| 38 |
return 'popup_templates'; |
| 39 |
} |
| 40 |
|
| 41 |
public function get_parent_slug(): string { |
| 42 |
return Menu_Config::ELEMENTOR_MENU_SLUG; |
| 43 |
} |
| 44 |
|
| 45 |
public function get_label(): string { |
| 46 |
return esc_html__( 'Popups', 'elementor' ); |
| 47 |
} |
| 48 |
|
| 49 |
public function get_group_id(): string { |
| 50 |
return Menu_Config::TEMPLATES_GROUP_ID; |
| 51 |
} |
| 52 |
|
| 53 |
public function get_name(): string { |
| 54 |
return 'popups'; |
| 55 |
} |
| 56 |
|
| 57 |
public function get_page_title() { |
| 58 |
return esc_html__( 'Popups', 'elementor' ); |
| 59 |
} |
| 60 |
|
| 61 |
public function get_promotion_title() { |
| 62 |
return $this->promotion_data['title']; |
| 63 |
} |
| 64 |
|
| 65 |
public function get_promotion_description() { |
| 66 |
return $this->promotion_data['content']; |
| 67 |
} |
| 68 |
|
| 69 |
public function get_cta_url() { |
| 70 |
return $this->promotion_data['action_button']['url']; |
| 71 |
} |
| 72 |
|
| 73 |
public function get_cta_text() { |
| 74 |
return $this->promotion_data['action_button']['text']; |
| 75 |
} |
| 76 |
} |
| 77 |
|