PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.3
Elementor Website Builder – more than just a page builder v3.28.3
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 / base-promotion-item.php

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

73 lines 1.9 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\Utils\Promotions\Filtered_Promotions_Manager;
6 use Elementor\Modules\Promotions\AdminMenuItems\Interfaces\Promotion_Menu_Item;
7 use Elementor\Settings;
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13 abstract class Base_Promotion_Item implements Promotion_Menu_Item {
14
15 public function get_name() {
16 return 'base_promotion';
17 }
18
19 public function is_visible() {
20 return true;
21 }
22
23 public function get_parent_slug() {
24 return Settings::PAGE_ID;
25 }
26
27 public function get_capability() {
28 return 'manage_options';
29 }
30
31 public function get_cta_text() {
32 return esc_html__( 'Upgrade Now', 'elementor' );
33 }
34
35 public function get_image_url() {
36 return ELEMENTOR_ASSETS_URL . 'images/go-pro-wp-dashboard.svg';
37 }
38
39 public function get_promotion_description() {
40 return '';
41 }
42
43 public function render() {
44 $config = [
45 'title' => $this->get_promotion_title(),
46 'description' => $this->get_promotion_description(),
47 'image' => $this->get_image_url(),
48 'upgrade_text' => $this->get_cta_text(),
49 'upgrade_url' => $this->get_cta_url(),
50 ];
51
52 $config = Filtered_Promotions_Manager::get_filtered_promotion_data( $config, 'elementor/' . $this->get_name() . '/custom_promotion', 'upgrade_url' );
53
54 $description = $config['description'] ?? $this->get_promotion_description() ?? '';
55
56 ?>
57 <div class="wrap">
58 <div class="elementor-blank_state">
59 <img src="<?php echo esc_url( $config['image'] ?? $this->get_image_url() ); ?>" loading="lazy" />
60
61 <h3><?php echo esc_html( $config['title'] ?? $this->get_promotion_title() ); ?></h3>
62 <?php if ( $description ) : ?>
63 <p><?php echo esc_html( $description ); ?></p>
64 <?php endif; ?>
65 <a class="elementor-button go-pro" href="<?php echo esc_url( $config['upgrade_url'] ?? $this->get_cta_url() ); ?>">
66 <?php echo esc_html( $config['upgrade_text'] ?? $this->get_cta_text() ); ?>
67 </a>
68 </div>
69 </div>
70 <?php
71 }
72 }
73