PluginProbe
Elementor Website Builder – more than just a page builder / 3.25.3
Elementor Website Builder – more than just a page builder v3.25.3
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 / modules / checklist / steps / setup-header.php

setup-header.php in Elementor Website Builder – more than just a page builder 3.25.3, at modules/checklist/steps/setup-header.php

105 lines 2.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\Checklist\Steps;
4
5 use Elementor\Core\Isolation\Wordpress_Adapter_Interface;
6 use Elementor\Modules\Checklist\Module as Checklist_Module;
7 use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
8 use Elementor\Utils;
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit; // Exit if accessed directly.
12 }
13
14 class Setup_Header extends Step_Base {
15 const STEP_ID = 'setup_header';
16
17 public function __construct( $module, $wordpress_adapter = null, $kit_adapter = null, $should_promote = true ) {
18 $promotion_data = $should_promote
19 ? $this->render_promotion()
20 : null;
21
22 parent::__construct( $module, $wordpress_adapter, $kit_adapter, $promotion_data );
23 }
24
25 public function get_id() : string {
26 return self::STEP_ID;
27 }
28
29 public function is_visible() : bool {
30 if ( Utils::has_pro() ) {
31 return false;
32 }
33
34 return parent::is_visible();
35 }
36
37 public function is_absolute_completed() : bool {
38 $args = [
39 'post_type' => 'elementor_library',
40 'meta_query' => [
41 'relation' => 'AND',
42 [
43 'key' => '_elementor_template_type',
44 'value' => 'header',
45 'compare' => '=',
46 ],
47 [
48 'key' => '_elementor_conditions',
49 ],
50 ],
51 'posts_per_page' => 1,
52 'fields' => 'ids',
53 'no_found_rows' => true,
54 'update_post_term_cache' => false,
55 'update_post_meta_cache' => false,
56 ];
57 $query = $this->wordpress_adapter->get_query( $args );
58 $header_templates = $query->posts ?? [];
59
60 return count( $header_templates ) >= 1;
61 }
62
63 public function get_title() : string {
64 return esc_html__( 'Set up a header', 'elementor' );
65 }
66
67 public function get_description() : string {
68 return esc_html__( 'This element applies across different pages, so visitors can easily navigate around your site.', 'elementor' );
69 }
70
71 public function get_cta_text() : string {
72 return esc_html__( 'Add a header', 'elementor' );
73 }
74
75 public function get_cta_url() : string {
76 return '';
77 }
78
79 public function get_image_src() : string {
80 return 'https://assets.elementor.com/checklist/v1/images/checklist-step-4.jpg';
81 }
82
83 public function get_is_completion_immutable() : bool {
84 return false;
85 }
86
87 public function get_learn_more_url() : string {
88 return 'https://go.elementor.com/app-website-checklist-header-article';
89 }
90
91 private function render_promotion() {
92 return Filtered_Promotions_Manager::get_filtered_promotion_data(
93 [
94 'url' => 'https://go.elementor.com/go-pro-website-checklist-header',
95 'text' => esc_html__( 'Upgrade Now', 'elementor' ),
96 'icon' => 'default',
97 ],
98 'elementor/checklist/promotion',
99 'upgrade_url'
100 );
101
102 }
103
104 }
105