Elementor Custom Skin - Version 1.1.3

Version Description

  • Fixed issue with Archive dynamic background
  • Fixed issue with Post Custom Skin dynamic background in editor mode
Download this release

Release Info

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

Code changes from version 1.0.9 to 1.1.3

ele-custom-skin.php CHANGED
@@ -1,16 +1,18 @@
1
  <?php
2
  /*
3
  * Plugin Name: Ele Custom Skin
4
- * Version: 1.0.9
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: elecustomskin
10
  * Domain Path: /languages
11
  * License: GPLv3
12
  * License URI: http://www.gnu.org/licenses/gpl-3.0
13
  */
 
 
14
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
 
16
  define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
@@ -27,3 +29,47 @@ add_action('elementor/widgets/widgets_registered','elecs_add_skins');
27
  function elecs_add_skins(){
28
  require_once ELECS_DIR.'skins/skin-custom.php';
29
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
  * Plugin Name: Ele Custom Skin
4
+ * Version: 1.1.3
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
11
  * License: GPLv3
12
  * License URI: http://www.gnu.org/licenses/gpl-3.0
13
  */
14
+
15
+
16
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
 
18
  define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
29
  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
+
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: dudaster
3
  Tags: page-builder, elementor, loop, archive list, post widget, skin, custom
4
  Donate link: https://www.paypal.me/dudaster
5
- Requires at least: 4.6
6
- Tested up to: 4.9.8
7
- Stable tag: 1.0.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,6 +59,21 @@ Add to your template a Post or Post Archive widget and from Skins select Custom
59
 
60
  == Changelog ==
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  = 1.0.9 =
63
  * Fixed issue with preview template in editor mode
64
 
2
  Contributors: dudaster
3
  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.3
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.3 =
63
+ * Fixed issue with Archive dynamic background
64
+ * Fixed issue with Post Custom Skin dynamic background in editor mode
65
+
66
+ = 1.1.2 =
67
+ * Fixed bugs
68
+
69
+ = 1.1.1 =
70
+ * Added support for dynamic background for overlay and motion effects in sections and columns.
71
+ * Fixed bugs
72
+
73
+ = 1.1.0 =
74
+ * Added support for dynamic background for sections and columns. Background motions effects not yet supported.
75
+ * Fixed multi language support
76
+
77
  = 1.0.9 =
78
  * Fixed issue with preview template in editor mode
79
 
skins/skin-custom.php CHANGED
@@ -24,7 +24,7 @@ class Skin_Posts_ECS extends Skin_Base {
24
  }
25
 
26
  public function get_title() {
27
- return __( 'Custom', 'elementor-pro' );
28
  }
29
 
30
  protected function _register_controls_actions() {
@@ -44,7 +44,7 @@ class Skin_Posts_ECS extends Skin_Base {
44
  $this->add_control(
45
  'skin_template',
46
  [
47
- 'label' => __( 'Select a template', 'elecustomskin' ),
48
  'type' => Controls_Manager::SELECT2,
49
  'label_block' => true,
50
  'default' => [],
@@ -55,7 +55,7 @@ class Skin_Posts_ECS extends Skin_Base {
55
  $this->add_control(//this would make use of 100% if width
56
  'view',
57
  [
58
- 'label' => __( 'View', 'elecustomskin' ),
59
  'type' => \Elementor\Controls_Manager::HIDDEN,
60
  'default' => 'top',
61
  'prefix_class' => 'elementor-posts--thumbnail-',
@@ -118,10 +118,13 @@ class Skin_Posts_ECS extends Skin_Base {
118
  }
119
 
120
  protected function get_template(){
 
 
121
  $settings = $this->parent->get_settings();
122
  $this->pid=get_the_ID();//set the current id in private var usefull to passid
123
  if (!$this->get_instance_value( 'skin_template' )) return;
124
  $return = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $this->get_instance_value( 'skin_template' ) );
 
125
  return $return;
126
  }
127
 
@@ -140,7 +143,7 @@ class Skin_Posts_ECS extends Skin_Base {
140
  else echo $this->get_template();
141
  }
142
 
143
- else echo "Select a Loop template! If you don't have one go to Elementor &gt; My Templates.";
144
 
145
 
146
  $this->render_post_footer();
@@ -165,7 +168,7 @@ class Skin_Archive_ECS extends Skin_Posts_ECS {
165
  }
166
 
167
  public function get_title() {
168
- return __( 'Custom', 'elementor-pro' );
169
  }
170
  }
171
 
24
  }
25
 
26
  public function get_title() {
27
+ return __( 'Custom', 'ele-custom-skin' );
28
  }
29
 
30
  protected function _register_controls_actions() {
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' => [],
55
  $this->add_control(//this would make use of 100% if width
56
  'view',
57
  [
58
+ 'label' => __( 'View', 'ele-custom-skin' ),
59
  'type' => \Elementor\Controls_Manager::HIDDEN,
60
  'default' => 'top',
61
  'prefix_class' => 'elementor-posts--thumbnail-',
118
  }
119
 
120
  protected function get_template(){
121
+ global $ecs_render_loop;
122
+ $ecs_render_loop=get_the_ID().",".$this->get_instance_value( 'skin_template' );
123
  $settings = $this->parent->get_settings();
124
  $this->pid=get_the_ID();//set the current id in private var usefull to passid
125
  if (!$this->get_instance_value( 'skin_template' )) return;
126
  $return = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $this->get_instance_value( 'skin_template' ) );
127
+ $ecs_render_loop=false;
128
  return $return;
129
  }
130
 
143
  else echo $this->get_template();
144
  }
145
 
146
+ else _e( "Select a Loop template! If you don't have one go to Elementor &gt; My Templates.", 'ele-custom-skin');
147
 
148
 
149
  $this->render_post_footer();
168
  }
169
 
170
  public function get_title() {
171
+ return __( 'Custom', 'ele-custom-skin' );
172
  }
173
  }
174
 
theme-builder/documents/loop.php CHANGED
@@ -21,7 +21,7 @@ class Loop extends Theme_Document {
21
  }
22
 
23
  public static function get_title() {
24
- return __( 'Loop', 'elementor-pro' );
25
  }
26
 
27
  public static function get_preview_as_default() {
21
  }
22
 
23
  public static function get_title() {
24
+ return __( 'Loop', 'ele-custom-skin' );
25
  }
26
 
27
  public static function get_preview_as_default() {
theme-builder/dynamic-tags/tags/post-summary.php CHANGED
@@ -15,7 +15,7 @@ class Post_Summary extends Tag {
15
  }
16
 
17
  public function get_title() {
18
- return __( 'Post Summary', 'elementor-pro' );
19
  }
20
 
21
  public function get_group() {
@@ -30,7 +30,7 @@ class Post_Summary extends Tag {
30
  $this->add_control(
31
  'length',
32
  [
33
- 'label' => __( 'Length', 'elementor-pro' ),
34
  'type' => Controls_Manager::NUMBER,
35
  'default' => 25,
36
  'min' => 0,
15
  }
16
 
17
  public function get_title() {
18
+ return __( 'Post Summary', 'ele-custom-skin' );
19
  }
20
 
21
  public function get_group() {
30
  $this->add_control(
31
  'length',
32
  [
33
+ 'label' => __( 'Length', 'ele-custom-skin' ),
34
  'type' => Controls_Manager::NUMBER,
35
  'default' => 25,
36
  'min' => 0,