Elementor Custom Skin - Version 1.1.5

Version Description

  • Fixed bugs
Download this release

Release Info

Developer dudaster
Plugin Icon 128x128 Elementor Custom Skin
Version 1.1.5
Comparing to
See all releases

Code changes from version 1.1.4 to 1.1.5

assets/dudaster_icon.png ADDED
Binary file
ele-custom-skin.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /*
3
  * Plugin Name: Ele Custom Skin
4
- * Version: 1.1.4
5
  * Description: Elementor Custom Skin for Posts and Archive Posts. You can create a skin as you want.
6
  * Plugin URI: https://www.eletemplator.com
7
- * Author: Liviu Duda
8
  * Author URI: https://www.leadpro.ro
9
  * Text Domain: ele-custom-skin
10
  * Domain Path: /languages
@@ -16,6 +16,7 @@
16
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
 
18
  define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
 
19
  add_action( 'elementor_pro/init', 'elecs_elementor_init' );
20
  function elecs_elementor_init(){
21
  //load templates types
@@ -30,46 +31,10 @@ function elecs_add_skins(){
30
  require_once ELECS_DIR.'skins/skin-custom.php';
31
  }
32
 
33
- // dynamic background fix
34
- function ECS_set_bg_element( \Elementor\Element_Base $element ) {
35
- global $ecs_render_loop;
36
- if(!$ecs_render_loop)
37
- return; // only act inside loop
38
- list($PostID,$LoopID)=explode(",",$ecs_render_loop);
39
- $ElementID = $element->get_ID();
40
- $dynamic_settings = $element->get_settings( '__dynamic__' );
41
- $all_controls = $element->get_controls();
42
- $all_controls = isset($all_controls) ? $all_controls : []; $dynamic_settings = isset($dynamic_settings) ? $dynamic_settings : [];
43
- $controls = array_intersect_key( $all_controls, $dynamic_settings );
44
- $settings = $element->parse_dynamic_settings( $dynamic_settings, $controls);
45
-
46
- /* start custom css */
47
- $css_rules['section']['normal'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:not(.elementor-motion-effects-element-type-background), #post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} > .elementor-motion-effects-container > .elementor-motion-effects-layer";
48
- $css_rules['section']['hover'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:hover";
49
- $css_rules['section']['overlay'] ="#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} > .elementor-background-overlay";
50
- $css_rules['section']['overlay_hover']="#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:hover > .elementor-background-overlay";
51
- $css_rules['column']['normal'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:not(.elementor-motion-effects-element-type-background) > .elementor-element-populated, #post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} > .elementor-column-wrap > .elementor-motion-effects-container > .elementor-motion-effects-layer";
52
- $css_rules['column']['hover'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:hover > .elementor-element-populated";
53
- $css_rules['column']['overlay'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} > .elementor-element-populated > .elementor-background-overlay";
54
- $css_rules['column']['overlay_hover'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:hover > .elementor-element-populated > .elementor-background-overlay";
55
-
56
- $bg['normal']= isset($settings["background_image"]["url"]) ? $settings["background_image"]["url"] : (isset($settings["_background_image"]["url"]) ? $settings["_background_image"]["url"] : "");
57
- $bg['hover']= isset($settings["background_hover_image"]["url"]) ? $settings["background_hover_image"]["url"] : (isset($settings["_background_hover_image"]["url"]) ? $settings["_background_hover_image"]["url"] : "");
58
- $bg['overlay']= isset($settings["background_overlay_image"]["url"]) ? $settings["background_overlay_image"]["url"] : (isset($settings["_background_overlay_image"]["url"]) ? $settings["_background_overlay_image"]["url"] : "");
59
- $bg['overlay_hover']= isset($settings["background_overlay_hover_image"]["url"]) ? $settings["background_overlay_hover_image"]["url"] : (isset($settings["_background_overlay_hover_image"]["url"]) ? $settings["_background_overlay_hover_image"]["url"] : "");
60
-
61
- $key_element = $element->get_name()=='section' ? "section" : "column";
62
-
63
- $ECS_css="";
64
- foreach($css_rules[$key_element] as $key => $value){
65
- $ECS_css.=$bg[$key] ? $css_rules[$key_element][$key]." {background-image:url(".$bg[$key].");} " : "";
66
- }
67
-
68
- echo $ECS_css ? "<style>".$ECS_css."</style>" :"";
69
- /* end custom css*/
70
- }
71
-
72
- add_action( 'elementor/frontend/section/before_render', 'ECS_set_bg_element' );
73
- add_action( 'elementor/frontend/column/before_render', 'ECS_set_bg_element' );
74
-
75
 
 
 
 
1
  <?php
2
  /*
3
  * Plugin Name: Ele Custom Skin
4
+ * Version: 1.1.5
5
  * Description: Elementor Custom Skin for Posts and Archive Posts. You can create a skin as you want.
6
  * Plugin URI: https://www.eletemplator.com
7
+ * Author: Dudaster.com
8
  * Author URI: https://www.leadpro.ro
9
  * Text Domain: ele-custom-skin
10
  * Domain Path: /languages
16
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
 
18
  define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
19
+ define( 'ELECS_NAME', plugin_basename( __FILE__ ));
20
  add_action( 'elementor_pro/init', 'elecs_elementor_init' );
21
  function elecs_elementor_init(){
22
  //load templates types
31
  require_once ELECS_DIR.'skins/skin-custom.php';
32
  }
33
 
34
+ // it gives me time to do some testing with pro version
35
+ if (date("Y-m-d") > "2019-08-12")
36
+ include_once ELECS_DIR.'includes/pro-features.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ // dynamic background fix
39
+ require_once ELECS_DIR.'includes/background-fix.php';
40
+ //require_once ELECS_DIR.'includes/pro-features.php';
includes/background-fix.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ // dynamic background fix
5
+ function ECS_set_bg_element( \Elementor\Element_Base $element ) {
6
+ global $ecs_render_loop;
7
+ if(!$ecs_render_loop)
8
+ return; // only act inside loop
9
+ list($PostID,$LoopID)=explode(",",$ecs_render_loop);
10
+ $ElementID = $element->get_ID();
11
+ $dynamic_settings = $element->get_settings( '__dynamic__' );
12
+ $all_controls = $element->get_controls();
13
+ $all_controls = isset($all_controls) ? $all_controls : []; $dynamic_settings = isset($dynamic_settings) ? $dynamic_settings : [];
14
+ $controls = array_intersect_key( $all_controls, $dynamic_settings );
15
+ $settings = $element->parse_dynamic_settings( $dynamic_settings, $controls);
16
+
17
+ /* start custom css */
18
+ $css_rules['section']['normal'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:not(.elementor-motion-effects-element-type-background), #post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} > .elementor-motion-effects-container > .elementor-motion-effects-layer";
19
+ $css_rules['section']['hover'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:hover";
20
+ $css_rules['section']['overlay'] ="#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} > .elementor-background-overlay";
21
+ $css_rules['section']['overlay_hover']="#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:hover > .elementor-background-overlay";
22
+ $css_rules['column']['normal'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:not(.elementor-motion-effects-element-type-background) > .elementor-element-populated, #post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} > .elementor-column-wrap > .elementor-motion-effects-container > .elementor-motion-effects-layer";
23
+ $css_rules['column']['hover'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:hover > .elementor-element-populated";
24
+ $css_rules['column']['overlay'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} > .elementor-element-populated > .elementor-background-overlay";
25
+ $css_rules['column']['overlay_hover'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}:hover > .elementor-element-populated > .elementor-background-overlay";
26
+
27
+ $bg['normal']= isset($settings["background_image"]["url"]) ? $settings["background_image"]["url"] : (isset($settings["_background_image"]["url"]) ? $settings["_background_image"]["url"] : "");
28
+ $bg['hover']= isset($settings["background_hover_image"]["url"]) ? $settings["background_hover_image"]["url"] : (isset($settings["_background_hover_image"]["url"]) ? $settings["_background_hover_image"]["url"] : "");
29
+ $bg['overlay']= isset($settings["background_overlay_image"]["url"]) ? $settings["background_overlay_image"]["url"] : (isset($settings["_background_overlay_image"]["url"]) ? $settings["_background_overlay_image"]["url"] : "");
30
+ $bg['overlay_hover']= isset($settings["background_overlay_hover_image"]["url"]) ? $settings["background_overlay_hover_image"]["url"] : (isset($settings["_background_overlay_hover_image"]["url"]) ? $settings["_background_overlay_hover_image"]["url"] : "");
31
+
32
+ $key_element = $element->get_name()=='section' ? "section" : "column";
33
+
34
+ $ECS_css="";
35
+ foreach($css_rules[$key_element] as $key => $value){
36
+ $ECS_css.=$bg[$key] ? $css_rules[$key_element][$key]." {background-image:url(".$bg[$key].");} " : "";
37
+ }
38
+
39
+ echo $ECS_css ? "<style>".$ECS_css."</style>" :"";
40
+ /* end custom css*/
41
+ }
42
+
43
+ add_action( 'elementor/frontend/section/before_render', 'ECS_set_bg_element' );
44
+ add_action( 'elementor/frontend/column/before_render', 'ECS_set_bg_element' );
45
+
46
+ //keep track of index
47
+
48
+ add_action( 'elementor/frontend/widget/before_render', function ( \Elementor\Element_Base $element ) {
49
+ global $ecs_index;
50
+ if ( 'posts' === $element->get_name() || 'archive-posts' === $element->get_name()) {
51
+ $ecs_index=0;
52
+ }
53
+ } );
includes/pro-features.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ /*
5
+ *
6
+ * Plugin notices and links
7
+ *
8
+ */
9
+
10
+ function ecs_admin_notice(){
11
+ if (function_exists('ele_custom_skin_pro')) return;
12
+ $user_id = get_current_user_id();
13
+ if (get_user_meta( $user_id, 'ele_custom_skin_notice_dismissed' )) return;
14
+ $offer = '2019-12-29' > date("Y-m-d") ? 'Limited Offer: <b style="color:red;">Unlimited Sites Lifetime License</b>.':"";
15
+ $image = '<img width="30px" src="'.plugin_dir_url( __FILE__ ) . 'assets/dudaster_icon.png" style="width:32px;margin-right:10px;margin-bottom: -11px;"/>';
16
+ $user = wp_get_current_user();
17
+ if ( in_array( 'administrator', (array) $user->roles ) ) {
18
+ echo '<div class="notice notice-info " style="padding-right: 38px; position: relative;">
19
+ <p> '.$image.' Ele Custom Skin <b>PRO</b> is out <a href="https://dudaster.com/ecs-pro/" target="_blank">Check it out!</a>. '.$offer.' <a class="button button-primary" style="margin-left:20px;" href="https://dudaster.com/ecs-pro/" target="_blank">Get it now!</a></p>
20
+ <a href="?ele_custom_skin_notice_dismissed"><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></a>
21
+ </div>';
22
+ }
23
+ }
24
+ add_action('admin_notices', 'ecs_admin_notice');
25
+
26
+ function ele_custom_skin_notice_dismissed() {
27
+ $user_id = get_current_user_id();
28
+ if ( isset( $_GET['ele_custom_skin_notice_dismissed'] ) )
29
+ add_user_meta( $user_id, 'ele_custom_skin_notice_dismissed', 'true', true );
30
+ }
31
+ add_action( 'admin_init', 'ele_custom_skin_notice_dismissed' );
32
+
33
+ add_filter( 'plugin_row_meta', 'ele_custom_skin_row_meta', 10, 2 );
34
+ function ele_custom_skin_row_meta( $links, $file ) {
35
+ if (ELECS_NAME == $file ) {
36
+ $row_meta = array(
37
+ 'video' => '<a href="' . esc_url( 'https://www.youtube.com/watch?v=DwLFdaZ69KU&feature=youtu.be&t=94' ) . '" target="_blank" aria-label="' . esc_attr__( 'Video Tutorial', 'ele-custom-skin' ) . '" >' . esc_html__( 'Video Tutorial', 'ele-custom-skin' ) . '</a>'
38
+ );
39
+
40
+ return array_merge( $links, $row_meta );
41
+ }
42
+ return (array) $links;
43
+ }
44
+
45
+ function elecs_action_links( $links ) {
46
+ $links = array_merge($links, array(
47
+ '<a href="' . esc_url( admin_url( '/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=loop' ) ) . '">' . __( 'Add Loop Template', 'ele-custom-skin' ) . '</a>',
48
+ ));
49
+
50
+ if (!function_exists('ele_custom_skin_pro')) $links = array_merge($links, array(
51
+ '<a href="' . esc_url( 'https://dudaster.com/ecs-pro/' ) . '" target="_blank" aria-label="' . esc_attr__( 'Go Pro', 'ele-custom-skin' ) . '" style="color:#39b54a;font-weight:bold;">' . esc_html__( 'Go Pro', 'ele-custom-skin' ) . '</a>'
52
+ ));
53
+ return $links;
54
+ }
55
+ add_action( 'plugin_action_links_' . ELECS_NAME, 'elecs_action_links' );
56
+
57
+ /*
58
+ *
59
+ * Pro features preview
60
+ *
61
+ */
62
+
63
+ if(!function_exists('ele_custom_skin_pro')){
64
+ require_once ELECS_DIR.'includes/pro-preview.php';
65
+ }
includes/pro-preview.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ *
4
+ * Pro features preview
5
+ *
6
+ */
7
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
+
9
+ add_action( 'ECS_after_control', function($skin){
10
+
11
+
12
+ $skin->add_control(
13
+ 'hr1',
14
+ [
15
+ 'type' => \Elementor\Controls_Manager::DIVIDER,
16
+ ]
17
+ );
18
+
19
+ $skin->add_control(
20
+ 'alt_title',
21
+ [
22
+ 'label' => __( 'Alternating templates', 'ele-custom-skin' ),
23
+ 'type' => \Elementor\Controls_Manager::HEADING,
24
+ ]
25
+ );
26
+
27
+ $repeater = new \Elementor\Repeater();
28
+
29
+ $repeater->add_control(
30
+ 'nth',
31
+ [
32
+ 'label' => __( '<i><b>n</b></i> th post', 'ele-custom-skin' ),
33
+ 'type' => \Elementor\Controls_Manager::NUMBER,
34
+ 'label_block' => false,
35
+ 'separator' => 'after',
36
+ 'placeholder' => __( 'nth', 'ele-custom-skin' ),
37
+ 'default' => __( '1', 'ele-custom-skin' ),
38
+ 'min' => 1,
39
+ 'dynamic' => [
40
+ 'active' => true,
41
+ ],
42
+ ]
43
+ );
44
+
45
+
46
+ $repeater->add_control(
47
+ 'skin_template',
48
+ [
49
+ 'label' => __( 'Select a default template', 'ele-custom-skin' ),
50
+ 'type' => \Elementor\Controls_Manager::SELECT2,
51
+ 'label_block' => true,
52
+ 'default' => [],
53
+ 'options' => $skin->get_skin_template(),
54
+ ]
55
+ );
56
+
57
+ $skin->add_control(
58
+ 'template_list',
59
+ [
60
+ 'label' => '',
61
+ 'type' => \Elementor\Controls_Manager::REPEATER,
62
+ 'fields' => $repeater->get_controls(),
63
+ 'default' => [
64
+ [
65
+ 'nth' => 1,
66
+ 'skin_template' => []
67
+ ],
68
+ ],
69
+ 'title_field' => '<p style="text-align:center;"><i class="fa fa-lock" aria-hidden="true"></i> '.__('Template for every {{{nth}}}th post', 'ele-custom-skin').'</p>',
70
+ ]
71
+ );
72
+
73
+ $skin->add_control(
74
+ 'upgrade_note',
75
+ [
76
+ 'label' => __( '<i class="fa fa-lock-open" aria-hidden="true"></i> Alternative templates are a PRO feature. ', 'ele-custom-skin' ),
77
+ 'type' => \Elementor\Controls_Manager::RAW_HTML,
78
+ 'raw' => '<div style="padding-top:10px;line-height:1.6em;text-align:center;"><p>'.__( 'Get full features with Ele Custom Skin PRO, ', 'ele-custom-skin' ).'</p><p><a href="https://dudaster.com/ecs-pro/" target="_blank">'.__( 'Upgrade NOW!', 'ele-custom-skin' ).'</a></p></div>',
79
+ 'content_classes' => 'your-class',
80
+ ]
81
+ );
82
+
83
+ } , 10, 3 );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: page-builder, elementor, loop, archive list, post widget, skin, custom
4
  Donate link: https://www.paypal.me/dudaster
5
  Requires at least: 5.0
6
  Tested up to: 5.2.3
7
- Stable tag: 1.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,6 +59,9 @@ Add to your template a Post or Post Archive widget and from Skins select Custom
59
 
60
  == Changelog ==
61
 
 
 
 
62
  = 1.1.4 =
63
  * Fixed issue with ACF fields for Elementor PRO 2.6.X
64
 
4
  Donate link: https://www.paypal.me/dudaster
5
  Requires at least: 5.0
6
  Tested up to: 5.2.3
7
+ Stable tag: 1.1.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
59
 
60
  == Changelog ==
61
 
62
+ = 1.1.5 =
63
+ * Fixed bugs
64
+
65
  = 1.1.4 =
66
  * Fixed issue with ACF fields for Elementor PRO 2.6.X
67
 
skins/skin-custom.php CHANGED
@@ -40,18 +40,18 @@ class Skin_Posts_ECS extends Skin_Base {
40
 
41
  $this->parent = $widget;
42
 
43
-
44
- $this->add_control(
45
  'skin_template',
46
  [
47
- 'label' => __( 'Select a template', 'ele-custom-skin' ),
48
  'type' => Controls_Manager::SELECT2,
49
  'label_block' => true,
50
  'default' => [],
51
  'options' => $this->get_skin_template(),
52
  ]
53
  );
54
-
 
55
  $this->add_control(//this would make use of 100% if width
56
  'view',
57
  [
@@ -62,7 +62,16 @@ class Skin_Posts_ECS extends Skin_Base {
62
  ]
63
  );
64
 
65
- parent::register_controls($widget);
 
 
 
 
 
 
 
 
 
66
 
67
  $this->remove_control( 'img_border_radius' );
68
  $this->remove_control( 'meta_data' );
@@ -77,14 +86,15 @@ class Skin_Posts_ECS extends Skin_Base {
77
  $this->remove_control( 'read_more_text' );
78
  $this->remove_control( 'show_excerpt' );
79
  $this->remove_control( 'excerpt_length' );
80
-
 
81
 
82
  }
83
 
84
  private function get_post_id(){
85
  return $this->pid;
86
  }
87
- private function get_skin_template(){
88
  global $wpdb;
89
  $templates = $wpdb->get_results(
90
  "SELECT $wpdb->term_relationships.object_id as ID, $wpdb->posts.post_title as post_title FROM $wpdb->term_relationships
@@ -118,17 +128,28 @@ class Skin_Posts_ECS extends Skin_Base {
118
  }
119
 
120
  protected function get_template(){
121
- global $ecs_render_loop, $wp_query;
122
- $old_query=$wp_query;
123
- $new_query=new \WP_Query( array( 'p' => get_the_ID() ) );
124
- $wp_query = $new_query;
125
- $ecs_render_loop=get_the_ID().",".$this->get_instance_value( 'skin_template' );
126
  $settings = $this->parent->get_settings();
127
- $this->pid=get_the_ID();//set the current id in private var usefull to passid
128
- if (!$this->get_instance_value( 'skin_template' )) return;
129
- $return = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $this->get_instance_value( 'skin_template' ) );
130
- $ecs_render_loop=false;
131
- $wp_query = $old_query;
 
 
 
 
 
 
 
 
 
 
 
132
  return $return;
133
  }
134
 
40
 
41
  $this->parent = $widget;
42
 
43
+ $this->add_control(
 
44
  'skin_template',
45
  [
46
+ 'label' => __( 'Select a default template', 'ele-custom-skin' ),
47
  'type' => Controls_Manager::SELECT2,
48
  'label_block' => true,
49
  'default' => [],
50
  'options' => $this->get_skin_template(),
51
  ]
52
  );
53
+
54
+
55
  $this->add_control(//this would make use of 100% if width
56
  'view',
57
  [
62
  ]
63
  );
64
 
65
+ do_action( 'ECS_after_control', $this );
66
+
67
+ $this->add_control(
68
+ 'hr2',
69
+ [
70
+ 'type' => \Elementor\Controls_Manager::DIVIDER,
71
+ ]
72
+ );
73
+
74
+ parent::register_controls($widget);
75
 
76
  $this->remove_control( 'img_border_radius' );
77
  $this->remove_control( 'meta_data' );
86
  $this->remove_control( 'read_more_text' );
87
  $this->remove_control( 'show_excerpt' );
88
  $this->remove_control( 'excerpt_length' );
89
+
90
+
91
 
92
  }
93
 
94
  private function get_post_id(){
95
  return $this->pid;
96
  }
97
+ function get_skin_template(){
98
  global $wpdb;
99
  $templates = $wpdb->get_results(
100
  "SELECT $wpdb->term_relationships.object_id as ID, $wpdb->posts.post_title as post_title FROM $wpdb->term_relationships
128
  }
129
 
130
  protected function get_template(){
131
+ global $ecs_render_loop, $wp_query,$ecs_index;
132
+ $ecs_index++;
133
+ $old_query=$wp_query;
134
+ $new_query=new \WP_Query( array( 'p' => get_the_ID() ) );
135
+ $wp_query = $new_query;
136
  $settings = $this->parent->get_settings();
137
+ $this->pid=get_the_ID();//set the current id in private var usefull to passid
138
+ $default_template = $this->get_instance_value( 'skin_template' ) ;
139
+ $template = $default_template;
140
+ /* move to pro */
141
+ $template = apply_filters( 'ECS_action_template', $template,$this,$ecs_index );
142
+
143
+ $ecs_render_loop=get_the_ID().",".$template;
144
+ //echo $ecs_render_loop;
145
+
146
+
147
+ /* end pro */
148
+ //print_r($newTemplate[0]['skin_template']);
149
+ if (!$template) return;
150
+ $return = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template );
151
+ $ecs_render_loop=false;
152
+ $wp_query = $old_query;
153
  return $return;
154
  }
155
 
theme-builder/documents/loop.php CHANGED
@@ -11,7 +11,8 @@ class Loop extends Theme_Document {
11
  $properties = parent::get_properties();
12
 
13
  $properties['condition_type'] = 'general';
14
- $properties['location'] = 'archive';
 
15
 
16
  return $properties;
17
  }
@@ -36,4 +37,5 @@ class Loop extends Theme_Document {
36
  Single::get_preview_as_options()
37
  );
38
  }
 
39
  }
11
  $properties = parent::get_properties();
12
 
13
  $properties['condition_type'] = 'general';
14
+ $properties['location'] = 'archive';
15
+ //$properties['location'] = 'loop';
16
 
17
  return $properties;
18
  }
37
  Single::get_preview_as_options()
38
  );
39
  }
40
+
41
  }
theme-builder/init.php CHANGED
@@ -44,3 +44,18 @@ function elecs_add_more_types($settings){
44
  }
45
 
46
  add_filter( 'elementor_pro/editor/localize_settings', 'elecs_add_more_types' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
 
46
  add_filter( 'elementor_pro/editor/localize_settings', 'elecs_add_more_types' );
47
+
48
+
49
+ function elecs_register_elementor_locations( $elementor_theme_manager ) {
50
+
51
+ $elementor_theme_manager->register_location(
52
+ 'loop',
53
+ [
54
+ 'label' => __( 'Loop', 'ele-custom-skin' ),
55
+ 'multiple' => true,
56
+ 'edit_in_content' => true,
57
+ ]
58
+ );
59
+
60
+ }
61
+ //add_action( 'elementor/theme/register_locations', 'elecs_register_elementor_locations' );