PluginProbe ʕ •ᴥ•ʔ
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools / 3.0.41
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools v3.0.41
3.0.59 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 3.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.18 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.26 3.0.27 3.0.28 3.0.29 3.0.3 3.0.30 3.0.31 3.0.32 3.0.33 3.0.34 3.0.35 3.0.36 3.0.37 3.0.38 3.0.39 3.0.4 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.0.46 3.0.47 3.0.48 3.0.49 3.0.5 3.0.50 3.0.51 3.0.52 3.0.53 3.0.54 3.0.55 3.0.56 3.0.57 3.0.58 3.0.6 3.0.7 3.0.8 3.0.9
essential-classy-addons-for-elementor / classes / conditions-file.php
essential-classy-addons-for-elementor / classes Last commit date
builders 1 year ago documents 1 year ago builder-content.php 1 year ago class-helper.php 1 year ago class-loader.php 1 year ago class-panel-options.php 1 year ago conditions-file.php 1 year ago conditions-rules.php 1 year ago elementor-document.php 1 year ago theme-builder.php 1 year ago widgets-passing-lists.php 1 year ago
conditions-file.php
62 lines
1 <?php
2 if (!defined('ABSPATH')) {
3 exit; // Exit if accessed directly
4 }
5
6 class Ecafe_Conditions_Data {
7
8 protected $conditions = [];
9
10 public function __construct() {
11 $this->init();
12 }
13
14 public function ec_add_condition($location, $post_id, $conditions = '') {
15 if ($location) {
16 if (is_array($this->conditions) && !isset($this->conditions[$location])) {
17 $this->conditions[$location] = [];
18 }
19 $this->conditions[$location][$post_id] = $conditions;
20 }
21
22 return $this;
23 }
24
25 public function ec_get_location_data($location) {
26 if (isset($this->conditions[$location])) {
27 return $this->conditions[$location];
28 }
29
30 return [];
31 }
32
33 public function init() {
34
35 $query = new \WP_Query([
36 'posts_per_page' => -1,
37 'post_type' => ECAFE_POST,
38 'post_status' => 'publish'
39 ]);
40 if( !empty($query) ){
41 if ( $query->have_posts() ) {
42 foreach ($query->posts as $post_id) {
43 $template_type = get_post_meta($post_id->ID,'ecafe_build_template_type',true);
44 $conditions = '';
45 if($template_type === 'header' || $template_type === 'footer'){
46 $conditions = get_post_meta($post_id->ID,'ecafe_build_template_display',true);
47 }else if($template_type === 'singular'){
48 $conditions = get_post_meta($post_id->ID,'ecafe_build_display_singular',true);
49 }else if($template_type === 'archives'){
50 $conditions = get_post_meta($post_id->ID,'ecafe_build_display_archives',true);
51 }else if($template_type === 'page404'){
52 $conditions = '404page';
53 }
54
55 $this->ec_add_condition($template_type, $post_id->ID, $conditions);
56 }
57 }
58 }
59 return $this;
60 }
61 }
62