Cherry Team Members - Version 1.4.3

Version Description

Download this release

Release Info

Developer TemplateMonster 2002
Plugin Icon 128x128 Cherry Team Members
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

cherry-framework/cherry-core.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Class Cherry Core
4
- * Version: 1.5.4
5
  *
6
  * @package Cherry_Framework
7
  * @subpackage Class
1
  <?php
2
  /**
3
  * Class Cherry Core
4
+ * Version: 1.5.4.1
5
  *
6
  * @package Cherry_Framework
7
  * @subpackage Class
cherry-framework/modules/cherry-customizer/cherry-customizer.php CHANGED
@@ -988,7 +988,7 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
988
  public function file_exists( $file ) {
989
 
990
  if ( ! function_exists( 'WP_Filesystem' ) ) {
991
- include_once( ABSPATH . '/wp-admin/includes/file.php' );
992
  }
993
 
994
  WP_Filesystem();
@@ -1013,7 +1013,7 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
1013
  public function get_file( $file ) {
1014
 
1015
  if ( ! function_exists( 'WP_Filesystem' ) ) {
1016
- include_once( ABSPATH . '/wp-admin/includes/file.php' );
1017
  }
1018
 
1019
  WP_Filesystem();
988
  public function file_exists( $file ) {
989
 
990
  if ( ! function_exists( 'WP_Filesystem' ) ) {
991
+ return file_exists( $file );
992
  }
993
 
994
  WP_Filesystem();
1013
  public function get_file( $file ) {
1014
 
1015
  if ( ! function_exists( 'WP_Filesystem' ) ) {
1016
+ return Cherry_Toolkit::get_file( $file );
1017
  }
1018
 
1019
  WP_Filesystem();
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/min/ui-repeater.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"use strict";t.utilites.namespace("ui_elements.repeater"),t.ui_elements.repeater={repeaterContainerClass:".cherry-ui-repeater-container",repeaterListClass:".cherry-ui-repeater-list",repeaterItemClass:".cherry-ui-repeater-item",repeaterItemHandleClass:".cherry-ui-repeater-actions-box",repeaterTitleClass:".cherry-ui-repeater-title",addItemButtonClass:".cherry-ui-repeater-add",removeItemButtonClass:".cherry-ui-repeater-remove",toggleItemButtonClass:".cherry-ui-repeater-toggle",minItemClass:"cherry-ui-repeater-min",sortablePlaceholderClass:"sortable-placeholder",init:function(){e(document).on("ready",this.addEvents.bind(this))},addEvents:function(){e("body").on("click",this.addItemButtonClass,{self:this},this.addItem).on("click",this.removeItemButtonClass,{self:this},this.removeItem).on("click",this.toggleItemButtonClass,{self:this},this.toggleItem).on("change",this.repeaterListClass+" input, "+this.repeaterListClass+" textarea, "+this.repeaterListClass+" select",{self:this},this.changeWrapperLable).on("sortable-init",{self:this},this.sortableItem),e(document).on("cherry-ui-elements-init",{self:this},this.sortableItem),this.triggers()},triggers:function(t){return e("body").trigger("sortable-init"),t&&e(document).trigger("cherry-ui-elements-init",{target:t}),this},addItem:function(t){var s=t.data.self,a=e(this).prev(s.repeaterListClass),r=a.data("index"),i=a.data("name"),l=wp.template(i),n=a.data("widget-id"),o={index:r};n="__i__"!==n?n:a.attr("id"),n&&(o.widgetId=n),a.append(l(o)),r++,a.data("index",r),s.triggers(e(s.repeaterItemClass+":last",a)).stopDefaultEvent(t)},removeItem:function(t){var s=t.data.self,a=e(this).closest(s.repeaterListClass);s.applyChanges(a),e(this).closest(s.repeaterItemClass).remove(),s.triggers().stopDefaultEvent(t)},toggleItem:function(t){var s=t.data.self,a=e(this).closest(s.repeaterItemClass);a.toggleClass(s.minItemClass),s.stopDefaultEvent(t)},sortableItem:function(t){var s,a,r=t.data.self,i=e(r.repeaterListClass);i.each(function(t,i){s=e(i),a=e(i).data("sortable-init"),s.sortable(a?"refresh":{items:r.repeaterItemClass,handle:r.repeaterItemHandleClass,cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:r.sortablePlaceholderClass,create:function(){s.data("sortable-init",!0)},update:function(t){var s=e(t.target);r.applyChanges(s)}})})},changeWrapperLable:function(t){var s,a,r=t.data.self,i=e(r.repeaterListClass),l=i.data("title-field"),n=e(this);l&&n.closest("."+l+"-wrap")[0]&&(s=n.val(),a=n.closest(r.repeaterItemClass),e(r.repeaterTitleClass,a).html(s)),r.stopDefaultEvent(t)},applyChanges:function(t){return void 0!==wp.customize&&e("input[name]:first, select[name]:first",t).change(),this},stopDefaultEvent:function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),this}},t.ui_elements.repeater.init()}(jQuery,window.CherryJsCore);
1
+ !function(e,t){"use strict";t.utilites.namespace("ui_elements.repeater"),t.ui_elements.repeater={repeaterContainerClass:".cherry-ui-repeater-container",repeaterListClass:".cherry-ui-repeater-list",repeaterItemClass:".cherry-ui-repeater-item",repeaterItemHandleClass:".cherry-ui-repeater-actions-box",repeaterTitleClass:".cherry-ui-repeater-title",addItemButtonClass:".cherry-ui-repeater-add",removeItemButtonClass:".cherry-ui-repeater-remove",toggleItemButtonClass:".cherry-ui-repeater-toggle",minItemClass:"cherry-ui-repeater-min",sortablePlaceholderClass:"sortable-placeholder",init:function(){e(document).on("ready",this.addEvents.bind(this))},addEvents:function(){e("body").on("click",this.addItemButtonClass,{self:this},this.addItem).on("click",this.removeItemButtonClass,{self:this},this.removeItem).on("click",this.toggleItemButtonClass,{self:this},this.toggleItem).on("change",this.repeaterListClass+" input, "+this.repeaterListClass+" textarea, "+this.repeaterListClass+" select",{self:this},this.changeWrapperLable).on("sortable-init",{self:this},this.sortableItem),e(document).on("cherry-ui-elements-init",{self:this},this.sortableItem),this.triggers()},triggers:function(t){return e("body").trigger("sortable-init"),t&&e(document).trigger("cherry-ui-elements-init",{target:t}),this},addItem:function(t){var r=t.data.self,a=e(this).prev(r.repeaterListClass),s=a.data("index"),i=a.data("name"),n=wp.template(i),l=a.data("widget-id"),o={index:s};(l="__i__"!==l?l:a.attr("id"))&&(o.widgetId=l),a.append(n(o)),s++,a.data("index",s),r.triggers(e(r.repeaterItemClass+":last",a)).stopDefaultEvent(t)},removeItem:function(t){var r=t.data.self,a=e(this).closest(r.repeaterListClass);r.applyChanges(a),e(this).closest(r.repeaterItemClass).remove(),r.triggers().stopDefaultEvent(t)},toggleItem:function(t){var r=t.data.self;e(this).closest(r.repeaterItemClass).toggleClass(r.minItemClass),r.stopDefaultEvent(t)},sortableItem:function(t){var r,a,s=t.data.self;e(s.repeaterListClass).each(function(t,i){r=e(i),(a=e(i).data("sortable-init"))?r.sortable("refresh"):r.sortable({items:s.repeaterItemClass,handle:s.repeaterItemHandleClass,cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,distance:2,tolerance:"pointer",helper:function(e,t){return t.clone().find(":input").attr("name",function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t}).end()},opacity:.65,placeholder:s.sortablePlaceholderClass,create:function(){r.data("sortable-init",!0)},update:function(t){var r=e(t.target);s.applyChanges(r)}})})},changeWrapperLable:function(t){var r,a,s=t.data.self,i=e(s.repeaterListClass).data("title-field"),n=e(this);i&&n.closest("."+i+"-wrap")[0]&&(r=n.val(),a=n.closest(s.repeaterItemClass),e(s.repeaterTitleClass,a).html(r)),s.stopDefaultEvent(t)},applyChanges:function(t){return void 0!==wp.customize&&e("input[name]:first, select[name]:first",t).change(),this},stopDefaultEvent:function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),this}},t.ui_elements.repeater.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/ui-repeater.js CHANGED
@@ -118,7 +118,16 @@
118
  scrollSensitivity: 40,
119
  forcePlaceholderSize: true,
120
  forceHelperSize: false,
121
- helper: 'clone',
 
 
 
 
 
 
 
 
 
122
  opacity: 0.65,
123
  placeholder: self.sortablePlaceholderClass,
124
  create: function() {
118
  scrollSensitivity: 40,
119
  forcePlaceholderSize: true,
120
  forceHelperSize: false,
121
+ distance: 2,
122
+ tolerance: 'pointer',
123
+ helper: function( event, element ) {
124
+ return element.clone()
125
+ .find( ':input' )
126
+ .attr( 'name', function( i, currentName ) {
127
+ return 'sort_' + parseInt( Math.random() * 100000, 10 ).toString() + '_' + currentName;
128
+ } )
129
+ .end();
130
+ },
131
  opacity: 0.65,
132
  placeholder: self.sortablePlaceholderClass,
133
  create: function() {
cherry-team-members.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Cherry Team Members
4
  * Plugin URI:
5
  * Description: Cherry Team Members plugin allows you to showcase your team and personnel.
6
- * Version: 1.4.2
7
  * Author: JetImpex
8
  * Author URI: https://jetimpex.com/wordpress/
9
  * Text Domain: cherry-team
@@ -45,7 +45,7 @@ if ( ! class_exists( 'Cherry_Team_Members' ) ) {
45
  *
46
  * @var string
47
  */
48
- private $version = '1.4.2';
49
 
50
  /**
51
  * Plugin dir URL
@@ -225,7 +225,7 @@ if ( ! class_exists( 'Cherry_Team_Members' ) ) {
225
  'cherry-team',
226
  $this->plugin_url( 'public/assets/js/cherry-team.js' ),
227
  array( 'cherry-js-core' ),
228
- '1.0.0',
229
  true
230
  );
231
 
3
  * Plugin Name: Cherry Team Members
4
  * Plugin URI:
5
  * Description: Cherry Team Members plugin allows you to showcase your team and personnel.
6
+ * Version: 1.4.3
7
  * Author: JetImpex
8
  * Author URI: https://jetimpex.com/wordpress/
9
  * Text Domain: cherry-team
45
  *
46
  * @var string
47
  */
48
+ private $version = '1.4.3';
49
 
50
  /**
51
  * Plugin dir URL
225
  'cherry-team',
226
  $this->plugin_url( 'public/assets/js/cherry-team.js' ),
227
  array( 'cherry-js-core' ),
228
+ $this->version(),
229
  true
230
  );
231
 
public/assets/js/cherry-team.js CHANGED
@@ -2,8 +2,7 @@
2
 
3
  "use strict";
4
 
5
- CherryJsCore.utilites.namespace( 'teamMembersPublic' );
6
- CherryJsCore.teamMembersPublic = {
7
 
8
  settings: {
9
  selectors: {
@@ -24,32 +23,56 @@
24
  templates: {
25
  loaderLarge: '<a href="#" class="team-loader loader-large">' + window.cherryTeam.loader + '</a>',
26
  loaderSmall: '<a href="#" class="team-loader loader-small">' + window.cherryTeam.loader + '</a>',
 
 
 
 
 
27
  }
28
  },
29
 
30
  init: function () {
31
-
32
  var self = this;
33
-
34
- // Document ready event check
35
- if ( CherryJsCore.status.is_ready ) {
36
- self.render( self );
37
- } else {
38
- CherryJsCore.variable.$document.on( 'ready', self.render( self ) );
39
- }
40
-
41
  },
42
 
43
  render: function ( self ) {
44
 
45
- var self = self;
46
-
47
  $( self.settings.selectors.main ).each( function() {
48
- self.initFilters( $( this ), self );
49
- self.initLoadMore( $( this ), self );
50
- self.initPager( $( this ), self );
51
  } );
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  },
54
 
55
  addLoader: function( $container, isMore ) {
@@ -73,14 +96,20 @@
73
  $container.find( this.settings.selectors.loader ).remove();
74
  },
75
 
76
- initFilters: function( $item, self ) {
 
 
 
 
 
 
77
 
78
- var $filter = $item.find( self.settings.selectors.filter ),
79
- $result = $item.find( self.settings.selectors.result ),
80
- $container = $item.find( self.settings.selectors.container ),
81
  data = new Object();
82
 
83
- $filter.on( 'click', self.settings.selectors.filterLink, function( event ) {
84
 
85
  var $this = $( this ),
86
  $parent = $this.parent();
@@ -94,10 +123,10 @@
94
  data.group = $this.data( 'term' );
95
  data.atts = $container.data( 'atts' );
96
  data.groups = $container.data( 'groups' );
97
- data.action = self.settings.actions.filter;
98
 
99
  $parent.addClass( 'active' ).siblings().removeClass( 'active' );
100
- self.addLoader( $container, false );
101
 
102
  $.ajax({
103
  url: window.cherryTeam.ajaxurl,
@@ -105,25 +134,25 @@
105
  dataType: 'json',
106
  data: data,
107
  error: function() {
108
- self.removeLoader( $container, false );
109
  }
110
  }).done( function( response ) {
111
- self.removeLoader( $container, false );
112
  $result.html( response.data.result );
113
  $container.data( 'atts', response.data.atts );
114
  $container.data( 'page', 1 );
115
  $container.data( 'pages', response.data.pages );
116
 
117
- if ( 1 < response.data.pages && $( self.settings.selectors.loadMore ).length ) {
118
- $( self.settings.selectors.loadMore ).removeClass( 'btn-hidden' );
119
  }
120
 
121
- if ( 1 == response.data.pages && $( self.settings.selectors.loadMore ).length ) {
122
- $( self.settings.selectors.loadMore ).addClass( 'btn-hidden' );
123
  }
124
 
125
- if ( $( self.settings.selectors.pager ).length ) {
126
- $( self.settings.selectors.pager ).remove();
127
  }
128
 
129
  $container.append( response.data.pager );
@@ -132,13 +161,19 @@
132
  });
133
  },
134
 
135
- initLoadMore: function( $item, self ) {
 
 
 
 
 
 
136
 
137
- $item.on( 'click', self.settings.selectors.loadMore, function( event ) {
138
 
139
  var $this = $( this ),
140
- $result = $item.find( self.settings.selectors.result ),
141
- $container = $item.find( self.settings.selectors.container ),
142
  pages = $container.data( 'pages' ),
143
  data = new Object();
144
 
@@ -146,9 +181,9 @@
146
 
147
  data.page = $container.data( 'page' );
148
  data.atts = $container.data( 'atts' );
149
- data.action = self.settings.actions.more;
150
 
151
- self.addLoader( $container, true );
152
 
153
  $.ajax({
154
  url: window.cherryTeam.ajaxurl,
@@ -156,10 +191,10 @@
156
  dataType: 'json',
157
  data: data,
158
  error: function() {
159
- self.removeLoader( $container, true );
160
  }
161
  }).done( function( response ) {
162
- self.removeLoader( $container, true );
163
  $result.append( response.data.result );
164
  $container.data( 'page', response.data.page );
165
 
@@ -173,13 +208,19 @@
173
 
174
  },
175
 
176
- initPager: function( $item, self ) {
 
 
 
 
 
 
177
 
178
- $item.on( 'click', self.settings.selectors.pager + ' a.page-numbers', function( event ) {
179
 
180
  var $this = $( this ),
181
- $result = $item.find( self.settings.selectors.result ),
182
- $container = $item.find( self.settings.selectors.container ),
183
  pages = $container.data( 'pages' ),
184
  data = new Object();
185
 
@@ -187,9 +228,9 @@
187
 
188
  data.page = $this.data( 'page' );
189
  data.atts = $container.data( 'atts' );
190
- data.action = self.settings.actions.pager;
191
 
192
- self.addLoader( $container, false );
193
 
194
  $this.addClass( 'current' ).siblings().removeClass( 'current' );
195
 
@@ -199,11 +240,11 @@
199
  dataType: 'json',
200
  data: data,
201
  error: function() {
202
- self.removeLoader( $container, false );
203
  }
204
  }).done( function( response ) {
205
 
206
- self.removeLoader( $container, false );
207
  $result.html( response.data.result );
208
  $container.data( 'page', response.data.page );
209
 
@@ -215,6 +256,6 @@
215
 
216
  }
217
 
218
- CherryJsCore.teamMembersPublic.init();
219
 
220
  }( jQuery ) );
2
 
3
  "use strict";
4
 
5
+ var teamMembersPublic = {
 
6
 
7
  settings: {
8
  selectors: {
23
  templates: {
24
  loaderLarge: '<a href="#" class="team-loader loader-large">' + window.cherryTeam.loader + '</a>',
25
  loaderSmall: '<a href="#" class="team-loader loader-small">' + window.cherryTeam.loader + '</a>',
26
+ },
27
+ state: {
28
+ filters: false,
29
+ more: false,
30
+ pager: false
31
  }
32
  },
33
 
34
  init: function () {
 
35
  var self = this;
36
+ self.render( self );
 
 
 
 
 
 
 
37
  },
38
 
39
  render: function ( self ) {
40
 
 
 
41
  $( self.settings.selectors.main ).each( function() {
42
+ self.initFilters( $( this ) );
43
+ self.initLoadMore( $( this ) );
44
+ self.initPager( $( this ) );
45
  } );
46
 
47
+ $( window ).on( 'elementor/frontend/init', self.initElementorWidget );
48
+
49
+ },
50
+
51
+ initElementorWidget: function() {
52
+
53
+ window.elementorFrontend.hooks.addAction(
54
+ 'frontend/element_ready/cherry_team.default',
55
+ function( $scope ) {
56
+
57
+ var $container = $scope.find( teamMembersPublic.settings.selectors.main );
58
+
59
+ if ( $container.length ) {
60
+
61
+ if ( window.elementorFrontend.isEditMode() ) {
62
+ teamMembersPublic.settings.state.filters = false;
63
+ teamMembersPublic.settings.state.more = false;
64
+ teamMembersPublic.settings.state.pager = false;
65
+ }
66
+
67
+ teamMembersPublic.initFilters( $container );
68
+ teamMembersPublic.initLoadMore( $container );
69
+ teamMembersPublic.initPager( $container );
70
+
71
+ }
72
+
73
+ }
74
+ );
75
+
76
  },
77
 
78
  addLoader: function( $container, isMore ) {
96
  $container.find( this.settings.selectors.loader ).remove();
97
  },
98
 
99
+ initFilters: function( $item ) {
100
+
101
+ if ( false !== teamMembersPublic.settings.state.filters ) {
102
+ return;
103
+ }
104
+
105
+ teamMembersPublic.settings.state.filters = true;
106
 
107
+ var $filter = $item.find( teamMembersPublic.settings.selectors.filter ),
108
+ $result = $item.find( teamMembersPublic.settings.selectors.result ),
109
+ $container = $item.find( teamMembersPublic.settings.selectors.container ),
110
  data = new Object();
111
 
112
+ $filter.on( 'click', teamMembersPublic.settings.selectors.filterLink, function( event ) {
113
 
114
  var $this = $( this ),
115
  $parent = $this.parent();
123
  data.group = $this.data( 'term' );
124
  data.atts = $container.data( 'atts' );
125
  data.groups = $container.data( 'groups' );
126
+ data.action = teamMembersPublic.settings.actions.filter;
127
 
128
  $parent.addClass( 'active' ).siblings().removeClass( 'active' );
129
+ teamMembersPublic.addLoader( $container, false );
130
 
131
  $.ajax({
132
  url: window.cherryTeam.ajaxurl,
134
  dataType: 'json',
135
  data: data,
136
  error: function() {
137
+ teamMembersPublic.removeLoader( $container, false );
138
  }
139
  }).done( function( response ) {
140
+ teamMembersPublic.removeLoader( $container, false );
141
  $result.html( response.data.result );
142
  $container.data( 'atts', response.data.atts );
143
  $container.data( 'page', 1 );
144
  $container.data( 'pages', response.data.pages );
145
 
146
+ if ( 1 < response.data.pages && $( teamMembersPublic.settings.selectors.loadMore ).length ) {
147
+ $( teamMembersPublic.settings.selectors.loadMore ).removeClass( 'btn-hidden' );
148
  }
149
 
150
+ if ( 1 == response.data.pages && $( teamMembersPublic.settings.selectors.loadMore ).length ) {
151
+ $( teamMembersPublic.settings.selectors.loadMore ).addClass( 'btn-hidden' );
152
  }
153
 
154
+ if ( $( teamMembersPublic.settings.selectors.pager ).length ) {
155
+ $( teamMembersPublic.settings.selectors.pager ).remove();
156
  }
157
 
158
  $container.append( response.data.pager );
161
  });
162
  },
163
 
164
+ initLoadMore: function( $item ) {
165
+
166
+ if ( false !== teamMembersPublic.settings.state.more ) {
167
+ return;
168
+ }
169
+
170
+ teamMembersPublic.settings.state.more = true;
171
 
172
+ $item.on( 'click', teamMembersPublic.settings.selectors.loadMore, function( event ) {
173
 
174
  var $this = $( this ),
175
+ $result = $item.find( teamMembersPublic.settings.selectors.result ),
176
+ $container = $item.find( teamMembersPublic.settings.selectors.container ),
177
  pages = $container.data( 'pages' ),
178
  data = new Object();
179
 
181
 
182
  data.page = $container.data( 'page' );
183
  data.atts = $container.data( 'atts' );
184
+ data.action = teamMembersPublic.settings.actions.more;
185
 
186
+ teamMembersPublic.addLoader( $container, true );
187
 
188
  $.ajax({
189
  url: window.cherryTeam.ajaxurl,
191
  dataType: 'json',
192
  data: data,
193
  error: function() {
194
+ teamMembersPublic.removeLoader( $container, true );
195
  }
196
  }).done( function( response ) {
197
+ teamMembersPublic.removeLoader( $container, true );
198
  $result.append( response.data.result );
199
  $container.data( 'page', response.data.page );
200
 
208
 
209
  },
210
 
211
+ initPager: function( $item ) {
212
+
213
+ if ( false !== teamMembersPublic.settings.state.pager ) {
214
+ return;
215
+ }
216
+
217
+ teamMembersPublic.settings.state.pager = true;
218
 
219
+ $item.on( 'click', teamMembersPublic.settings.selectors.pager + ' a.page-numbers', function( event ) {
220
 
221
  var $this = $( this ),
222
+ $result = $item.find( teamMembersPublic.settings.selectors.result ),
223
+ $container = $item.find( teamMembersPublic.settings.selectors.container ),
224
  pages = $container.data( 'pages' ),
225
  data = new Object();
226
 
228
 
229
  data.page = $this.data( 'page' );
230
  data.atts = $container.data( 'atts' );
231
+ data.action = teamMembersPublic.settings.actions.pager;
232
 
233
+ teamMembersPublic.addLoader( $container, false );
234
 
235
  $this.addClass( 'current' ).siblings().removeClass( 'current' );
236
 
240
  dataType: 'json',
241
  data: data,
242
  error: function() {
243
+ teamMembersPublic.removeLoader( $container, false );
244
  }
245
  }).done( function( response ) {
246
 
247
+ teamMembersPublic.removeLoader( $container, false );
248
  $result.html( response.data.result );
249
  $container.data( 'page', response.data.page );
250
 
256
 
257
  }
258
 
259
+ teamMembersPublic.init();
260
 
261
  }( jQuery ) );
public/includes/class-cherry-team-data.php CHANGED
@@ -33,14 +33,6 @@ class Cherry_Team_Members_Data {
33
  */
34
  private $query_args = array();
35
 
36
- /**
37
- * Holder for the main query object, while team query processing
38
- *
39
- * @since 1.0.0
40
- * @var object
41
- */
42
- private $temp_query = null;
43
-
44
  /**
45
  * Sets up our actions/filters.
46
  *
@@ -153,12 +145,6 @@ class Cherry_Team_Members_Data {
153
  // The Query.
154
  $query = $this->get_team( $args );
155
 
156
- global $wp_query;
157
-
158
- $this->temp_query = $wp_query;
159
- $wp_query = null;
160
- $wp_query = $query;
161
-
162
  // Fix boolean.
163
  if ( isset( $args['pager'] ) && ( ( 'true' == $args['pager'] ) || true === $args['pager'] ) ) {
164
  $args['pager'] = true;
@@ -168,13 +154,6 @@ class Cherry_Team_Members_Data {
168
 
169
  $args['more'] = filter_var( $args['more'], FILTER_VALIDATE_BOOLEAN );
170
 
171
- // The Display.
172
- if ( ! $query || is_wp_error( $query ) ) {
173
- $wp_query = null;
174
- $wp_query = $this->temp_query;
175
- return;
176
- }
177
-
178
  $css_classes = array( 'cherry-team' );
179
 
180
  if ( ! empty( $args['wrap_class'] ) ) {
@@ -229,14 +208,11 @@ class Cherry_Team_Members_Data {
229
  $output .= '</div>';
230
 
231
  if ( true == $args['more'] ) {
232
- $output .= $this->get_more_button( $args );
233
  } elseif ( true === $args['pager'] ) {
234
- $output .= $this->get_pagination();
235
  }
236
 
237
- $wp_query = null;
238
- $wp_query = $this->temp_query;
239
-
240
  /**
241
  * Filters HTML-formatted team before display or return.
242
  *
@@ -303,6 +279,7 @@ class Cherry_Team_Members_Data {
303
  $this->query_args['posts_per_page'] = $args['limit'];
304
  $this->query_args['orderby'] = $args['orderby'];
305
  $this->query_args['order'] = $args['order'];
 
306
  $this->query_args['suppress_filters'] = false;
307
 
308
  if ( ! empty( $args['group'] ) ) {
@@ -408,8 +385,7 @@ class Cherry_Team_Members_Data {
408
  public function get_more_button( $atts = array(), $query = null ) {
409
 
410
  if ( ! $query ) {
411
- global $wp_query;
412
- $query = $wp_query;
413
  }
414
 
415
  $atts = wp_parse_args( $atts, array(
@@ -533,9 +509,7 @@ class Cherry_Team_Members_Data {
533
  * @param array $args The array of arguments.
534
  * @return string
535
  */
536
- public function get_team_loop( $query, $args ) {
537
-
538
- global $post, $more;
539
 
540
  // Item template.
541
  $template = cherry_team_members_templater()->get_template_by_name(
@@ -555,13 +529,15 @@ class Cherry_Team_Members_Data {
555
  $count = 1;
556
  $output = '';
557
 
558
- if ( ! is_object( $query ) || ! is_array( $query->posts ) ) {
559
  return false;
560
  }
561
 
562
  $callbacks = cherry_team_members_templater()->setup_template_data( $args );
563
 
564
- foreach ( $query->posts as $post ) {
 
 
565
 
566
  // Sets up global post data.
567
  setup_postdata( $post );
@@ -620,7 +596,6 @@ class Cherry_Team_Members_Data {
620
 
621
  }
622
 
623
- // Restore the global $post variable.
624
  wp_reset_postdata();
625
 
626
  return $output;
33
  */
34
  private $query_args = array();
35
 
 
 
 
 
 
 
 
 
36
  /**
37
  * Sets up our actions/filters.
38
  *
145
  // The Query.
146
  $query = $this->get_team( $args );
147
 
 
 
 
 
 
 
148
  // Fix boolean.
149
  if ( isset( $args['pager'] ) && ( ( 'true' == $args['pager'] ) || true === $args['pager'] ) ) {
150
  $args['pager'] = true;
154
 
155
  $args['more'] = filter_var( $args['more'], FILTER_VALIDATE_BOOLEAN );
156
 
 
 
 
 
 
 
 
157
  $css_classes = array( 'cherry-team' );
158
 
159
  if ( ! empty( $args['wrap_class'] ) ) {
208
  $output .= '</div>';
209
 
210
  if ( true == $args['more'] ) {
211
+ $output .= $this->get_more_button( $args, $query );
212
  } elseif ( true === $args['pager'] ) {
213
+ $output .= $this->get_pagination( $query );
214
  }
215
 
 
 
 
216
  /**
217
  * Filters HTML-formatted team before display or return.
218
  *
279
  $this->query_args['posts_per_page'] = $args['limit'];
280
  $this->query_args['orderby'] = $args['orderby'];
281
  $this->query_args['order'] = $args['order'];
282
+ $this->query_args['post_status'] = 'publish';
283
  $this->query_args['suppress_filters'] = false;
284
 
285
  if ( ! empty( $args['group'] ) ) {
385
  public function get_more_button( $atts = array(), $query = null ) {
386
 
387
  if ( ! $query ) {
388
+ return false;
 
389
  }
390
 
391
  $atts = wp_parse_args( $atts, array(
509
  * @param array $args The array of arguments.
510
  * @return string
511
  */
512
+ public function get_team_loop( $team_query, $args ) {
 
 
513
 
514
  // Item template.
515
  $template = cherry_team_members_templater()->get_template_by_name(
529
  $count = 1;
530
  $output = '';
531
 
532
+ if ( ! is_object( $team_query ) || ! is_array( $team_query->posts ) ) {
533
  return false;
534
  }
535
 
536
  $callbacks = cherry_team_members_templater()->setup_template_data( $args );
537
 
538
+ global $post;
539
+
540
+ foreach ( $team_query->posts as $post ) {
541
 
542
  // Sets up global post data.
543
  setup_postdata( $post );
596
 
597
  }
598
 
 
599
  wp_reset_postdata();
600
 
601
  return $output;
public/includes/ext/class-cherry-team-elementor-compat.php CHANGED
@@ -52,6 +52,17 @@ if ( ! class_exists( 'Cherry_Team_Members_Elementor_Compat' ) ) {
52
  add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) );
53
 
54
  add_action( 'wp_ajax_elementor_render_widget', array( $this, 'set_elementor_ajax' ), 10, -1 );
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  /**
52
  add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) );
53
 
54
  add_action( 'wp_ajax_elementor_render_widget', array( $this, 'set_elementor_ajax' ), 10, -1 );
55
+
56
+ add_action( 'elementor/frontend/before_enqueue_scripts', array( $this, 'assets' ) );
57
+ }
58
+
59
+ /**
60
+ * Ensure that team script correctly enqueued
61
+ *
62
+ * @return void
63
+ */
64
+ public function assets() {
65
+ wp_enqueue_script( 'cherry-team' );
66
  }
67
 
68
  /**
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
 
3
  Contributors: TemplateMonster 2002
4
  Tags: custom post type, team, cherry-framework, elementor, elementor builder
5
- Requires at least: 4.5
6
  Tested up to: 4.8.1
7
- Stable tag: 1.4.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
2
 
3
  Contributors: TemplateMonster 2002
4
  Tags: custom post type, team, cherry-framework, elementor, elementor builder
5
+ Requires at least: 4.7
6
  Tested up to: 4.8.1
7
+ Stable tag: 1.4.3
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10