PluginProbe ʕ •ᴥ•ʔ
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools / 3.0.27
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools v3.0.27
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-rules.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-rules.php
77 lines
1 <?php
2 defined('ABSPATH') || die();
3
4 class Ecafe_Condition_Rules {
5 public static $_instance = null;
6
7 private $storage;
8
9 public function __construct() {
10 $this->storage = new Ecafe_Conditions_Data();
11 }
12
13 public static function get_instance() {
14 if (is_null(self::$_instance)) {
15 self::$_instance = new self();
16 }
17
18 return self::$_instance;
19 }
20
21 public function ec_get_templates_ids( $location ) {
22 $templates = $this->get_templates_location( $location );
23 return $templates;
24 }
25
26 public function get_templates_location($location) {
27 $result = [];
28
29 $ec_get_location_data = $this->storage->ec_get_location_data($location);
30
31 if (empty($ec_get_location_data)) {
32 return $result;
33 }
34
35 foreach ($ec_get_location_data as $template_id => $conditions) {
36 if( ($location =='header' || $location=='footer') && $conditions === 'entire'){
37 $result[$template_id] = 10;
38 }else if( $location =='singular' ){
39 if(get_post_type() === $conditions){
40 $result[$template_id] = 10;
41 }
42 }else if( $location =='archives' ){
43 if ( is_category() && in_array('category', $conditions) ) {
44 $result[$template_id] = 10;
45 }else if ( is_tag() && in_array('post_tag', $conditions) ) {
46 $result[$template_id] = 10;
47 }else if(is_tax()){
48 foreach( $conditions as $tax ){
49 if(is_tax($tax)){
50 $result[$template_id] = 10;
51 break;
52 }
53 }
54 }
55 }else if( $location =='page404' && is_404() ){
56 $result[$template_id] = 10;
57 }
58 }
59 asort($result);
60
61 return $result;
62 }
63
64 public function ec_get_location_type( $location ) {
65 $templates_ids = $this->ec_get_templates_ids( $location );
66
67 $template_ids = [];
68 foreach ($templates_ids as $templates_id => $priority) {
69 $template_ids[] = $templates_id;
70 }
71
72 return $template_ids;
73 }
74 }
75
76 Ecafe_Condition_Rules::get_instance();
77