PluginProbe
Elementor Website Builder – more than just a page builder / 3.13.3
Elementor Website Builder – more than just a page builder v3.13.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
← All changes | core/editor/promotion.php +10 -40 4.2.13.13.3 View file →
@@ -1,55 +1,18 @@
1 1 <?php
2 2 namespace Elementor\Core\Editor;
3 3
4 -use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
5 4 use Elementor\Utils;
6 5
7 6 if ( ! defined( 'ABSPATH' ) ) {
8 - exit; // Exit if accessed directly.
7 + exit; // Exit if accessed directly
9 8 }
10 9
11 10 class Promotion {
12 -
13 - /**
14 - * @return array
15 - */
16 11 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 {
12 + // For BC
29 13 $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 14
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 15 return [
53 16 /* translators: %s: Widget title. */
54 17 'title' => __( '%s Widget', 'elementor' ),
55 18 /* translators: %s: Widget title. */
@@ -56,8 +19,15 @@
56 19 'content' => __(
57 20 'Use %s widget and dozens more pro features to extend your toolbox and build sites faster and better.',
58 21 'elementor'
59 22 ),
60 - 'action_button' => $this->get_action_button_content(),
23 + 'action_button' => [
24 + 'text' => $has_pro ?
25 + __( 'Connect & Activate', 'elementor' ) :
26 + __( 'Upgrade Now', 'elementor' ),
27 + 'url' => $has_pro ?
28 + admin_url( 'admin.php?page=elementor-license' ) :
29 + 'https://go.elementor.com/go-pro-%s',
30 + ],
61 31 ];
62 32 }
63 33 }