Elementor Custom Skin - Version 1.2.4

Version Description

  • Showing deleted templates in the Custom Skin field fixed.
  • Fixed Overflow issue. Now you can add shadows and other objects that can go outside the loop item.
  • Removed Post Per Page in Archive Posts Widget because it's a global query and does nothing. Posts Per Page globaly can be changed from Settings > Reading in Wordpress Dashboard
Download this release

Release Info

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

Code changes from version 1.2.1 to 1.2.4

ele-custom-skin.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Plugin Name: Ele Custom Skin
4
- * Version: 1.2.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,22 +18,36 @@ 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
- add_action( 'elementor_pro/init', 'elecs_elementor_init' );
22
- function elecs_elementor_init(){
23
- //load templates types
24
-
25
- //require_once ELECS_DIR.'theme-builder/init.php';
26
- require_once ELECS_DIR.'theme-builder/init.php';
27
 
28
- }
29
 
30
- add_action('elementor/widgets/widgets_registered','elecs_add_skins');
31
- function elecs_add_skins(){
32
- require_once ELECS_DIR.'skins/skin-custom.php';
33
- }
 
 
34
 
 
 
35
 
36
- include_once ELECS_DIR.'includes/pro-features.php';
37
 
38
- // dynamic background fix
39
- require_once ELECS_DIR.'includes/background-fix.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
  * Plugin Name: Ele Custom Skin
4
+ * Version: 1.2.4
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
+ $ecs_elementor=true;
22
+ include_once ELECS_DIR.'includes/ecs-notices.php';
 
 
 
 
23
 
24
+ //check if Elementor is installed
25
 
26
+ if ( !in_array( 'elementor/elementor.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) $ecs_elementor=false;
27
+ if ( !in_array( 'elementor-pro/elementor-pro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) $ecs_elementor=false;
28
+ if ($ecs_elementor) {
29
+ add_action( 'elementor_pro/init', 'elecs_elementor_init' );
30
+ function elecs_elementor_init(){
31
+ //load templates types
32
 
33
+ //require_once ELECS_DIR.'theme-builder/init.php';
34
+ require_once ELECS_DIR.'theme-builder/init.php';
35
 
36
+ }
37
 
38
+ add_action('elementor/widgets/widgets_registered','elecs_add_skins');
39
+ function elecs_add_skins(){
40
+ require_once ELECS_DIR.'skins/skin-custom.php';
41
+ }
42
+
43
+
44
+ include_once ELECS_DIR.'includes/pro-features.php';
45
+
46
+ // dynamic background fix
47
+ require_once ELECS_DIR.'includes/background-fix.php';
48
+
49
+ } else {
50
+ $notification = new Ecs_Notice(__( '<b>Ele Custom Skin</b> needs <b>Elementor</b> and <b>Elementor Pro</b> to work. Make sure you have them <b>both</b> installed.', 'ele-custom-skin' ));
51
+ $notification->set_type('error');
52
+ $notification->show();
53
+ }
includes/ecs-notices.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class Ecs_Notice {
5
+ /**
6
+ * Message of the notice.
7
+ *
8
+ * @since 1.2.2
9
+ * @access private
10
+ * @var string
11
+ */
12
+ private $message = "";
13
+
14
+ /**
15
+ * The id of the notice.
16
+ *
17
+ * @since 1.0.0
18
+ * @access private
19
+ * @var string
20
+ */
21
+ private $notice = "";
22
+
23
+ /**
24
+ * The id of the notice.
25
+ *
26
+ * @since 1.0.0
27
+ * @access private
28
+ * @var string
29
+ */
30
+ private $type = "info";
31
+
32
+ /**
33
+ * The user role.
34
+ *
35
+ * @since 1.0.0
36
+ * @access private
37
+ * @var string
38
+ */
39
+ private $role = 'administrator';
40
+
41
+ public function __construct($message,$notice="") {
42
+ $this->message = $message;
43
+ $this->notice = $notice;
44
+ }
45
+
46
+ public function set_role($role){
47
+ $this->role = $role;
48
+ }
49
+ public function set_type($type){
50
+ $this->type = $type;
51
+ }
52
+ public function show(){
53
+ add_action('admin_notices', [$this,'admin_notice']);
54
+ }
55
+ public function admin_notice(){
56
+ $user_id = get_current_user_id();
57
+ if ($this->notice && get_user_meta( $user_id, $this->notice )) return;
58
+ $image = '<img width="30px" src="'.ELECS_URL . 'assets/dudaster_icon.png" style="width:32px;margin-right:10px;margin-bottom: -11px;"/> ';
59
+ $user = wp_get_current_user();
60
+ if ( in_array( $this->role, (array) $user->roles ) ) {
61
+ echo '<div class="notice notice-'.$this->type.' " style="padding-right: 38px; position: relative;">
62
+ <p> '.$image.$this->message.'</p>
63
+ <a href="?ecsn_shown='.$this->notice.'"><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></a>
64
+ </div>';
65
+ }
66
+ }
67
+
68
+ }
69
+
70
+ function ecs_notice_dismiss() {
71
+ $user_id = get_current_user_id();
72
+ if ( isset( $_GET['ecsn_shown'] ) )
73
+ if ( $_GET['ecsn_shown']) add_user_meta( $user_id, $_GET['ecsn_shown'] , 'true', true );
74
+ }
75
+ add_action( 'admin_init', 'ecs_notice_dismiss' );
76
+
includes/pro-features.php CHANGED
@@ -11,7 +11,7 @@ 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="'.ELECS_URL . '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 ) ) {
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-10-10' > date("Y-m-d") ? 'Limited Offer: <b style="color:red;">Unlimited Sites Lifetime License</b>.':"";
15
  $image = '<img width="30px" src="'.ELECS_URL . '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 ) ) {
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.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -61,6 +61,18 @@ Add to your template a Post or Post Archive widget and from Skins select Custom
61
 
62
  == Changelog ==
63
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  = 1.2.1 =
65
  * Fixed summary length in case of a long excerpt
66
 
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.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
61
 
62
  == Changelog ==
63
 
64
+ = 1.2.4 =
65
+ * Showing deleted templates in the Custom Skin field fixed.
66
+ * Fixed Overflow issue. Now you can add shadows and other objects that can go outside the loop item.
67
+ * Removed Post Per Page in Archive Posts Widget because it's a global query and does nothing. Posts Per Page globaly can be changed from Settings > Reading in Wordpress Dashboard
68
+
69
+ = 1.2.3 =
70
+ * Fixed missing posts per page
71
+
72
+ = 1.2.2 =
73
+ * Fixed issue with missing Elementor
74
+ * Missing Layout style in Archive Posts Widget
75
+
76
  = 1.2.1 =
77
  * Fixed summary length in case of a long excerpt
78
 
skins/skin-custom.php CHANGED
@@ -28,12 +28,8 @@ class Skin_Posts_ECS extends Skin_Base {
28
  }
29
 
30
  protected function _register_controls_actions() {
31
- add_action( 'elementor/element/archive-posts/section_layout/before_section_end', [ $this, 'register_controls' ] );
32
- add_action( 'elementor/element/archive-posts/section_query/after_section_end', [ $this, 'register_style_sections' ] );
33
-
34
  add_action( 'elementor/element/posts/section_layout/before_section_end', [ $this, 'register_controls' ] );
35
  add_action( 'elementor/element/posts/section_query/after_section_end', [ $this, 'register_style_sections' ] );
36
-
37
  }
38
 
39
  public function register_controls( Widget_Base $widget ) {
@@ -103,7 +99,8 @@ class Skin_Posts_ECS extends Skin_Base {
103
  INNER JOIN $wpdb->terms ON
104
  $wpdb->term_taxonomy.term_id=$wpdb->terms.term_id AND $wpdb->terms.slug='loop'
105
  INNER JOIN $wpdb->posts ON
106
- $wpdb->term_relationships.object_id=$wpdb->posts.ID"
 
107
  );
108
  $options = [ '' => '' ];
109
  foreach ( $templates as $template ) {
@@ -183,7 +180,6 @@ class Skin_Posts_ECS extends Skin_Base {
183
 
184
  }
185
 
186
-
187
  }
188
 
189
 
@@ -194,7 +190,10 @@ class Skin_Archive_ECS extends Skin_Posts_ECS {
194
  private $template_cache=[];
195
  private $pid;
196
 
197
-
 
 
 
198
 
199
  public function get_id() {
200
  return 'archive_custom';
@@ -203,6 +202,10 @@ class Skin_Archive_ECS extends Skin_Posts_ECS {
203
  public function get_title() {
204
  return __( 'Custom', 'ele-custom-skin' );
205
  }
 
 
 
 
206
  }
207
 
208
  // Add a custom skin for the POSTS widget
28
  }
29
 
30
  protected function _register_controls_actions() {
 
 
 
31
  add_action( 'elementor/element/posts/section_layout/before_section_end', [ $this, 'register_controls' ] );
32
  add_action( 'elementor/element/posts/section_query/after_section_end', [ $this, 'register_style_sections' ] );
 
33
  }
34
 
35
  public function register_controls( Widget_Base $widget ) {
99
  INNER JOIN $wpdb->terms ON
100
  $wpdb->term_taxonomy.term_id=$wpdb->terms.term_id AND $wpdb->terms.slug='loop'
101
  INNER JOIN $wpdb->posts ON
102
+ $wpdb->term_relationships.object_id=$wpdb->posts.ID
103
+ WHERE $wpdb->posts.post_status='publish'"
104
  );
105
  $options = [ '' => '' ];
106
  foreach ( $templates as $template ) {
180
 
181
  }
182
 
 
183
  }
184
 
185
 
190
  private $template_cache=[];
191
  private $pid;
192
 
193
+ protected function _register_controls_actions() {
194
+ add_action( 'elementor/element/archive-posts/section_layout/before_section_end', [ $this, 'register_controls' ] );
195
+ add_action( 'elementor/element/archive-posts/section_layout/after_section_end', [ $this, 'register_style_sections' ] );
196
+ }
197
 
198
  public function get_id() {
199
  return 'archive_custom';
202
  public function get_title() {
203
  return __( 'Custom', 'ele-custom-skin' );
204
  }
205
+
206
+ /* Remove `posts_per_page` control */
207
+ protected function register_post_count_control(){}
208
+
209
  }
210
 
211
  // Add a custom skin for the POSTS widget