PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.4
Elementor Website Builder – more than just a page builder v4.1.4
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 4.0.7 All 451 releases
elementor / core / editor / promotion.php

promotion.php in Elementor Website Builder – more than just a page builder 4.1.4, at core/editor/promotion.php

64 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Core\Editor;
3
4 use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
5 use Elementor\Utils;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly.
9 }
10
11 class Promotion {
12
13 /**
14 * @return array
15 */
16 public function get_elements_promotion() {
17 return Filtered_Promotions_Manager::get_filtered_promotion_data(
18 $this->get_promotion_data(),
19 'elementor/editor/promotion/get_elements_promotion',
20 'action_button',
21 'url'
22 );
23 }
24
25 /**
26 * @return array
27 */
28 private function get_action_button_content(): array {
29 $has_pro = Utils::has_pro();
30 return $has_pro ? [
31 'text' => __( 'Connect & Activate', 'elementor' ),
32 'url' => admin_url( 'admin.php?page=elementor-license' ),
33 ] : [
34 'text' => __( 'Upgrade Now', 'elementor' ),
35 'url' => 'https://go.elementor.com/go-pro-%s',
36 ];
37 }
38
39 /**
40 * @return string
41 */
42 private function get_promotion_url(): string {
43 return Utils::has_pro()
44 ? admin_url( 'admin.php?page=elementor-license' )
45 : 'https://go.elementor.com/go-pro-%s';
46 }
47
48 /**
49 * @return array
50 */
51 private function get_promotion_data(): array {
52 return [
53 /* translators: %s: Widget title. */
54 'title' => __( '%s Widget', 'elementor' ),
55 /* translators: %s: Widget title. */
56 'content' => __(
57 'Use %s widget and dozens more pro features to extend your toolbox and build sites faster and better.',
58 'elementor'
59 ),
60 'action_button' => $this->get_action_button_content(),
61 ];
62 }
63 }
64