Version Description
- Added ability to use dynamic background to Elementor Widgets
- Added ability to use dynamic color on Widgets
- Added ability to use dynamic color on Sections and Columns
- Added ability to use dynamic color on borders, backgrounds and shape dividers
Download this release
Release Info
Developer | dudaster |
Plugin | Elementor Custom Skin |
Version | 1.4.0 |
Comparing to | |
See all releases |
Code changes from version 1.3.11 to 1.4.0
- ele-custom-skin.php +4 -4
- includes/background-fix.php +0 -53
- includes/dynamic-style.php +63 -0
- includes/flip-box-fix.php +0 -36
- readme.txt +8 -2
ele-custom-skin.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Ele Custom Skin
|
4 |
-
* Version: 1.
|
5 |
* Description: Elementor Custom Skin for Posts and Archive Posts. You can create a skin as you want.
|
6 |
* Plugin URI: https://dudaster.com
|
7 |
* Author: Dudaster.com
|
@@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
18 |
define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
|
19 |
define( 'ELECS_NAME', plugin_basename( __FILE__ ));
|
20 |
define( 'ELECS_URL', plugin_dir_url( __FILE__ ));
|
21 |
-
define ('ELECS_VER','1.
|
22 |
|
23 |
include_once ELECS_DIR.'includes/ecs-notices.php';
|
24 |
include_once ELECS_DIR.'includes/ecs-dependencies.php';
|
@@ -45,8 +45,8 @@ if (ecs_dependencies()) {
|
|
45 |
include_once ELECS_DIR.'includes/pro-features.php';
|
46 |
|
47 |
// dynamic background fix
|
48 |
-
require_once ELECS_DIR.'includes/
|
49 |
-
|
50 |
|
51 |
add_action('init', 'ecs_check_for_notification');
|
52 |
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Ele Custom Skin
|
4 |
+
* Version: 1.4.0
|
5 |
* Description: Elementor Custom Skin for Posts and Archive Posts. You can create a skin as you want.
|
6 |
* Plugin URI: https://dudaster.com
|
7 |
* Author: Dudaster.com
|
18 |
define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
|
19 |
define( 'ELECS_NAME', plugin_basename( __FILE__ ));
|
20 |
define( 'ELECS_URL', plugin_dir_url( __FILE__ ));
|
21 |
+
define ('ELECS_VER','1.4.0');
|
22 |
|
23 |
include_once ELECS_DIR.'includes/ecs-notices.php';
|
24 |
include_once ELECS_DIR.'includes/ecs-dependencies.php';
|
45 |
include_once ELECS_DIR.'includes/pro-features.php';
|
46 |
|
47 |
// dynamic background fix
|
48 |
+
require_once ELECS_DIR.'includes/dynamic-style.php';
|
49 |
+
|
50 |
|
51 |
add_action('init', 'ecs_check_for_notification');
|
52 |
|
includes/background-fix.php
DELETED
@@ -1,53 +0,0 @@
|
|
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/dynamic-style.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
3 |
+
|
4 |
+
function ECS_clean_selector_value($values){
|
5 |
+
$interest=["url"];
|
6 |
+
if(is_array($values)){
|
7 |
+
foreach ($values as $key => $value){
|
8 |
+
if (in_array($key,$interest)) return $value;
|
9 |
+
}
|
10 |
+
}
|
11 |
+
return $values;
|
12 |
+
}
|
13 |
+
function ECS_parse_selector($selector,$wrapper,$value){
|
14 |
+
$clean_value=ECS_clean_selector_value($value);
|
15 |
+
$selector = str_replace("{{WRAPPER}}",$wrapper,$selector);
|
16 |
+
$selector = str_replace(["{{VALUE}}","{{URL}}","{{UNIT}}"],$clean_value,$selector);
|
17 |
+
return $selector;
|
18 |
+
}
|
19 |
+
// dynamic style for elements
|
20 |
+
function ECS_set_dynamic_style( \Elementor\Element_Base $element ) {
|
21 |
+
global $ecs_render_loop;
|
22 |
+
if(!$ecs_render_loop)
|
23 |
+
return; // only act inside loop
|
24 |
+
list($PostID,$LoopID)=explode(",",$ecs_render_loop);
|
25 |
+
$ElementID = $element->get_ID();
|
26 |
+
$dynamic_settings = $element->get_settings( '__dynamic__' );
|
27 |
+
$all_controls = $element->get_controls();
|
28 |
+
|
29 |
+
$all_controls = isset($all_controls) ? $all_controls : []; $dynamic_settings = isset($dynamic_settings) ? $dynamic_settings : [];
|
30 |
+
$controls = array_intersect_key( $all_controls, $dynamic_settings );
|
31 |
+
|
32 |
+
$settings = @$element->parse_dynamic_settings( $dynamic_settings, $controls); // @ <- dirty fix for that fugly controls-stack.php Illegal string offset 'url' error
|
33 |
+
|
34 |
+
$ECS_css="";
|
35 |
+
$element_wrapper="#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID}";
|
36 |
+
|
37 |
+
foreach($controls as $key => $control){
|
38 |
+
if(isset($control["selectors"])){
|
39 |
+
foreach($control["selectors"] as $selector => $rules){
|
40 |
+
if(isset($settings[$key])) $ECS_css.= ECS_parse_selector($selector."{".$rules."}",$element_wrapper,$settings[$key]);
|
41 |
+
}
|
42 |
+
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
echo $ECS_css ? "<style>".$ECS_css."</style>" :"";
|
48 |
+
/* end custom css*/
|
49 |
+
}
|
50 |
+
|
51 |
+
add_action( 'elementor/frontend/section/before_render', 'ECS_set_dynamic_style' );
|
52 |
+
add_action( 'elementor/frontend/column/before_render', 'ECS_set_dynamic_style' );
|
53 |
+
|
54 |
+
add_action( 'elementor/frontend/widget/before_render', 'ECS_set_dynamic_style' );
|
55 |
+
|
56 |
+
//keep track of index
|
57 |
+
|
58 |
+
add_action( 'elementor/frontend/widget/before_render', function ( \Elementor\Element_Base $element ) {
|
59 |
+
global $ecs_index;
|
60 |
+
if ( 'posts' === $element->get_name() || 'archive-posts' === $element->get_name()) {
|
61 |
+
$ecs_index=0;
|
62 |
+
}
|
63 |
+
} );
|
includes/flip-box-fix.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
3 |
-
|
4 |
-
// dynamic background fix
|
5 |
-
function ECS_set_bg_element_flip_box( \Elementor\Element_Base $element ) {
|
6 |
-
global $ecs_render_loop;
|
7 |
-
|
8 |
-
if(!$ecs_render_loop || "flip-box" != $element->get_name())
|
9 |
-
return; // only act inside loop
|
10 |
-
list($PostID,$LoopID)=explode(",",$ecs_render_loop);
|
11 |
-
$ElementID = $element->get_ID();
|
12 |
-
$dynamic_settings = $element->get_settings( '__dynamic__' );
|
13 |
-
$all_controls = $element->get_controls();
|
14 |
-
$all_controls = isset($all_controls) ? $all_controls : []; $dynamic_settings = isset($dynamic_settings) ? $dynamic_settings : [];
|
15 |
-
$controls = array_intersect_key( $all_controls, $dynamic_settings );
|
16 |
-
$settings = $element->parse_dynamic_settings( $dynamic_settings, $controls);
|
17 |
-
//print_r($settings);
|
18 |
-
/* start custom css */
|
19 |
-
$css_rules['flip-box']['normal'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} .elementor-flip-box__front";
|
20 |
-
$css_rules['flip-box']['hover'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} .elementor-flip-box__back";
|
21 |
-
|
22 |
-
$bg['normal']= isset($settings["background_a_image"]["url"]) ? $settings["background_a_image"]["url"] :"";
|
23 |
-
$bg['hover']= isset($settings["background_b_image"]["url"]) ? $settings["background_b_image"]["url"] : "";
|
24 |
-
|
25 |
-
$key_element = 'flip-box';
|
26 |
-
|
27 |
-
$ECS_css="";
|
28 |
-
foreach($css_rules[$key_element] as $key => $value){
|
29 |
-
$ECS_css.=$bg[$key] ? $css_rules[$key_element][$key]." {background-image:url(".$bg[$key].");} " : "";
|
30 |
-
}
|
31 |
-
|
32 |
-
echo $ECS_css ? "<style>".$ECS_css."</style>" :"";
|
33 |
-
/* end custom css*/
|
34 |
-
}
|
35 |
-
|
36 |
-
add_action( 'elementor/frontend/widget/before_render', 'ECS_set_bg_element_flip_box' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: dudaster
|
|
3 |
Tags: page-builder, elementor, loop, archive list, post widget, skin, custom, post grid
|
4 |
Donate link: https://www.paypal.me/dudaster
|
5 |
Requires at least: 5.0
|
6 |
-
Tested up to: 5.3.
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -59,6 +59,12 @@ Add to your template a Post or Post Archive widget and from Skins select Custom
|
|
59 |
|
60 |
== Changelog ==
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
= 1.3.11 =
|
63 |
* Fixing compatibility issues Elementor Pro 2.9.0
|
64 |
|
3 |
Tags: page-builder, elementor, loop, archive list, post widget, skin, custom, post grid
|
4 |
Donate link: https://www.paypal.me/dudaster
|
5 |
Requires at least: 5.0
|
6 |
+
Tested up to: 5.3.2
|
7 |
+
Stable tag: 1.4.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
59 |
|
60 |
== Changelog ==
|
61 |
|
62 |
+
= 1.4.0 =
|
63 |
+
* Added ability to use dynamic background to Elementor Widgets
|
64 |
+
* Added ability to use dynamic color on Widgets
|
65 |
+
* Added ability to use dynamic color on Sections and Columns
|
66 |
+
* Added ability to use dynamic color on borders, backgrounds and shape dividers
|
67 |
+
|
68 |
= 1.3.11 =
|
69 |
* Fixing compatibility issues Elementor Pro 2.9.0
|
70 |
|