Accordion - Version 2.2.16

Version Description

Download this release

Release Info

Developer pickplugins
Plugin Icon 128x128 Accordion
Version 2.2.16
Comparing to
See all releases

Code changes from version 2.2.15 to 2.2.16

accordions.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accordions by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
5
  Description: Fully responsive and mobile ready accordion grid for wordpress.
6
- Version: 2.2.15
7
  WC requires at least: 3.0.0
8
  WC tested up to: 4.0
9
  Author: PickPlugins
@@ -23,7 +23,7 @@ class Accordions{
23
 
24
  define('accordions_plugin_url', plugins_url('/', __FILE__) );
25
  define('accordions_plugin_dir', plugin_dir_path( __FILE__ ) );
26
- define('accordions_version', '2.2.15' );
27
  define('accordions_plugin_name', 'Accordions' );
28
  define('accordions_plugin_basename', plugin_basename( __FILE__ ) );
29
 
3
  Plugin Name: Accordions by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
5
  Description: Fully responsive and mobile ready accordion grid for wordpress.
6
+ Version: 2.2.16
7
  WC requires at least: 3.0.0
8
  WC tested up to: 4.0
9
  Author: PickPlugins
23
 
24
  define('accordions_plugin_url', plugins_url('/', __FILE__) );
25
  define('accordions_plugin_dir', plugin_dir_path( __FILE__ ) );
26
+ define('accordions_version', '2.2.16' );
27
  define('accordions_plugin_name', 'Accordions' );
28
  define('accordions_plugin_basename', plugin_basename( __FILE__ ) );
29
 
assets/settings-tabs/settings-tabs.css CHANGED
@@ -305,6 +305,16 @@
305
  margin-bottom: 15px;
306
  }
307
 
 
 
 
 
 
 
 
 
 
 
308
  /*input*/
309
 
310
  .settings-tabs input[type="text"], .settings-tabs .range-slider, .settings-tabs input[type="email"],.settings-tabs textarea, .settings-tabs select, .settings-tabs input[type="range"]{
305
  margin-bottom: 15px;
306
  }
307
 
308
+
309
+ .settings-tabs .field-media-wrapper .media-upload, .field-media-wrapper .clear {
310
+ display: inline-block;
311
+ background: #ddd;
312
+ padding: 2px 10px;
313
+ border-radius: 3px;
314
+ border: 1px solid #999;
315
+ }
316
+
317
+
318
  /*input*/
319
 
320
  .settings-tabs input[type="text"], .settings-tabs .range-slider, .settings-tabs input[type="email"],.settings-tabs textarea, .settings-tabs select, .settings-tabs input[type="range"]{
assets/settings-tabs/settings-tabs.js CHANGED
@@ -30,30 +30,6 @@ jQuery(document).ready(function($){
30
 
31
  $(".settings-tabs .sortable" ).sortable({ handle: ".sort" });
32
 
33
- $(document).on('click','.settings-tabs .textarea-editor',function(){
34
-
35
- id = $(this).attr('id');
36
- editor_enabled = $(this).attr('editor_enabled');
37
-
38
-
39
- console.log(typeof wp.editor);
40
-
41
- if(editor_enabled == 'no' && typeof wp.editor != 'undefined'){
42
- wp.editor.initialize( id, {
43
- mediaButtons: true,
44
- tinymce: {
45
- toolbar1: 'bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,undo,redo'
46
- },
47
- quicktags: true,
48
- } );
49
-
50
- $(this).attr('editor_enabled','yes');
51
- }
52
-
53
-
54
-
55
-
56
- })
57
 
58
  $(document).on('click','.settings-tabs .tab-nav',function(){
59
 
@@ -234,11 +210,86 @@ jQuery(document).ready(function($){
234
  jQuery(this).parent().parent().removeClass("active");
235
  }else{
236
  jQuery(this).parent().parent().addClass("active");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  })
239
 
240
 
241
 
 
 
 
242
  jQuery(document).on("click", ".settings-tabs .field-repeatable-wrapper .clone", function() {
243
 
244
 
30
 
31
  $(".settings-tabs .sortable" ).sortable({ handle: ".sort" });
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  $(document).on('click','.settings-tabs .tab-nav',function(){
35
 
210
  jQuery(this).parent().parent().removeClass("active");
211
  }else{
212
  jQuery(this).parent().parent().addClass("active");
213
+ textarea_to_editor();
214
+ }
215
+ })
216
+
217
+ jQuery(document).on("click", ".settings-tabs .field-repeatable-wrapper .add-repeat-field", function() {
218
+ now = jQuery.now();
219
+ add_html = $(this).attr('add_html');
220
+
221
+ repeatable_html = add_html.replace(/TIMEINDEX/g, now);
222
+
223
+ $(this).parent().children('.repeatable-field-list').append(repeatable_html);
224
+
225
+ textarea_to_editor();
226
+
227
+
228
+ })
229
+
230
+
231
+ function textarea_to_editor(){
232
+
233
+ //textarea = $('.textarea-editor');
234
+
235
+ var textarea = document.getElementsByClassName("textarea-editor");
236
+
237
+ for (i = 0; i < textarea.length; i++) {
238
+
239
+ el_id = textarea[i].id;
240
+ el_attr = textarea[i].getAttribute('editor_enabled');
241
+
242
+ //editor_enabled = $(this).attr('editor_enabled');
243
+
244
+
245
+ //console.log(typeof wp.editor);
246
+
247
+ if(el_attr == 'no' && typeof wp.editor != 'undefined'){
248
+ wp.editor.initialize( el_id, {
249
+ mediaButtons: true,
250
+ tinymce: {
251
+ toolbar1: 'bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,undo,redo'
252
+ },
253
+ quicktags: true,
254
+ } );
255
+
256
+ textarea[i].setAttribute('editor_enabled','yes')
257
+ //$(this).attr('editor_enabled','yes');
258
+ }
259
+
260
+
261
+
262
  }
263
+
264
+ }
265
+
266
+ $(document).on('click','.settings-tabs .textarea-editor',function(){
267
+
268
+ id = $(this).attr('id');
269
+ editor_enabled = $(this).attr('editor_enabled');
270
+
271
+
272
+ //console.log(typeof wp.editor);
273
+
274
+ if(editor_enabled == 'no' && typeof wp.editor != 'undefined'){
275
+ wp.editor.initialize( id, {
276
+ mediaButtons: true,
277
+ tinymce: {
278
+ toolbar1: 'bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,undo,redo'
279
+ },
280
+ quicktags: true,
281
+ } );
282
+
283
+ $(this).attr('editor_enabled','yes');
284
+ }
285
+
286
  })
287
 
288
 
289
 
290
+
291
+
292
+
293
  jQuery(document).on("click", ".settings-tabs .field-repeatable-wrapper .clone", function() {
294
 
295
 
includes/class-post-meta-accordions-hook.php CHANGED
@@ -1088,7 +1088,7 @@ function accordions_metabox_content_content($post_id){
1088
  array(
1089
  'id' => 'body',
1090
  'css_id' => 'body_TIMEINDEX',
1091
- 'title' => __('Body','accordions'),
1092
  'details' => __('Accordion body content.','accordions'),
1093
  'type' => 'textarea_editor',
1094
  'value' => '',
1088
  array(
1089
  'id' => 'body',
1090
  'css_id' => 'body_TIMEINDEX',
1091
+ 'title' => __('Accordion body','accordions'),
1092
  'details' => __('Accordion body content.','accordions'),
1093
  'type' => 'textarea_editor',
1094
  'value' => '',
includes/class-settings-tabs.php CHANGED
@@ -521,71 +521,66 @@ class settings_tabs_field{
521
 
522
  $settings_tabs_field = new settings_tabs_field();
523
 
 
524
  ob_start();
525
  ?>
526
- <script>
527
- jQuery(document).ready(function($) {
528
- jQuery(document).on("click", ".field-repeatable-wrapper-<?php echo $css_id; ?> .add-repeat-field", function() {
529
-
530
-
531
- now = jQuery.now();
532
- fields_arr = <?php echo json_encode($fields); ?>;
533
- html = '<div class="item-wrap collapsible"><div class="header"><span class="remove" ' +
534
- 'onclick="jQuery(this).parent().parent().remove()"><?php echo $remove_text; ?></span> ';
535
- <?php if($sortable):?>
536
- html += '<span class="sort" ><i class="fas fa-arrows-alt"></i></span>';
537
- <?php endif; ?>
538
- html += ' <span class="title-text">#'+now+'</span></div>';
539
 
540
- <?php
541
 
542
- $fieldHtml = '';
 
543
 
544
- if(!empty($fields)):
545
- foreach ($fields as $field):
546
 
547
- $fieldType = isset($field['type']) ? $field['type'] : '';
548
- $field['parent'] = $field_name.'[TIMEINDEX]';
549
 
550
- ob_start();
551
- ?>
552
- <div class="item">
553
- <?php if($collapsible):?>
554
- <div class="content">
555
- <?php endif; ?>
556
 
557
- <?php
558
- $settings_tabs_field->generate_field($field);
559
- ?>
560
- <?php if($collapsible):?>
561
- </div>
562
- <?php endif; ?>
563
 
564
- </div>
565
- <?php
566
- $fieldHtml .= ob_get_clean();
567
- endforeach;
568
- endif;
569
 
 
 
 
 
 
570
 
571
- $string = str_replace("\n", "", $fieldHtml);
572
- $fieldHtml = str_replace("\r", "", $string);
573
 
 
 
574
 
575
- ?>
576
 
577
- fieldHtml = '<?php echo $fieldHtml; ?>';
578
- html+= fieldHtml.replace(/TIMEINDEX/g, now);
579
- html+='</div>';
580
 
581
- jQuery('.<?php echo 'field-repeatable-wrapper-'.$css_id; ?> .repeatable-field-list').append(html);
582
 
583
- })
584
- });
585
- </script>
586
  <div id="input-wrapper-<?php echo $css_id; ?>" class=" input-wrapper field-repeatable-wrapper
587
  field-repeatable-wrapper-<?php echo $css_id; ?>">
588
- <div class="add-repeat-field"><i class="far fa-plus-square"></i> <?php _e('Add','accordions'); ?></div>
589
  <div class="repeatable-field-list sortable" id="<?php echo $css_id; ?>">
590
  <?php
591
  if(!empty($values)):
@@ -760,7 +755,7 @@ class settings_tabs_field{
760
  $pro_text = isset( $option['pro_text'] ) ? $option['pro_text'] : '';
761
 
762
 
763
- var_dump($css_id);
764
 
765
  if($multiple){
766
  $value = isset( $option['value'] ) ? $option['value'] : array();
521
 
522
  $settings_tabs_field = new settings_tabs_field();
523
 
524
+
525
  ob_start();
526
  ?>
527
+ <div class="item-wrap collapsible">
528
+ <div class="header">
529
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><?php echo $remove_text; ?></span>
530
+ <?php
531
+ if($sortable):
532
+ ?>
533
+ <span class="sort" ><i class="fas fa-arrows-alt"></i></span>
534
+ <?php
535
+ endif;
536
+ ?>
537
+ <span class="title-text">#TIMEINDEX</span>
538
+ </div>
539
+ <?php
540
 
 
541
 
542
+ if(!empty($fields)):
543
+ foreach ($fields as $field):
544
 
545
+ $fieldType = isset($field['type']) ? $field['type'] : '';
546
+ $field['parent'] = $field_name.'[TIMEINDEX]';
547
 
 
 
548
 
549
+ ?>
550
+ <div class="item">
551
+ <?php if($collapsible):?>
552
+ <div class="content">
553
+ <?php endif; ?>
 
554
 
555
+ <?php
556
+ $settings_tabs_field->generate_field($field);
557
+ ?>
558
+ <?php if($collapsible):?>
559
+ </div>
560
+ <?php endif; ?>
561
 
562
+ </div>
563
+ <?php
 
 
 
564
 
565
+ endforeach;
566
+ endif;
567
+ ?>
568
+ </div>
569
+ <?php
570
 
571
+ $fieldHtml = ob_get_clean();
 
572
 
573
+ $fieldHtml = preg_replace("/[\r\n]+/", "\n", $fieldHtml);
574
+ $fieldHtml = preg_replace("/\s+/", ' ', $fieldHtml);
575
 
 
576
 
577
+ ob_start();
578
+ ?>
 
579
 
 
580
 
 
 
 
581
  <div id="input-wrapper-<?php echo $css_id; ?>" class=" input-wrapper field-repeatable-wrapper
582
  field-repeatable-wrapper-<?php echo $css_id; ?>">
583
+ <div add_html="<?php echo esc_attr($fieldHtml); ?>" class="add-repeat-field"><i class="far fa-plus-square"></i> <?php _e('Add','accordions'); ?></div>
584
  <div class="repeatable-field-list sortable" id="<?php echo $css_id; ?>">
585
  <?php
586
  if(!empty($values)):
755
  $pro_text = isset( $option['pro_text'] ) ? $option['pro_text'] : '';
756
 
757
 
758
+ //var_dump($css_id);
759
 
760
  if($multiple){
761
  $value = isset( $option['value'] ) ? $option['value'] : array();
readme.txt CHANGED
@@ -4,7 +4,7 @@
4
  Tags: accordion, tabs, FAQ, WooCommerce FAQ Tab, accordion short-code, accordions widget, tab
5
  Requires at least: 3.8
6
  Tested up to: 5.4
7
- Stable tag: 2.2.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -139,6 +139,10 @@ then paste this shortcode anywhere in your page to display accordions<br />
139
 
140
  == Changelog ==
141
 
 
 
 
 
142
  = 2.2.15=
143
  * 2020-04-13 - fix - schema content convert quotes to characters,
144
  * 2020-04-13 - fix - schema count issue fixed when hide set to true.
4
  Tags: accordion, tabs, FAQ, WooCommerce FAQ Tab, accordion short-code, accordions widget, tab
5
  Requires at least: 3.8
6
  Tested up to: 5.4
7
+ Stable tag: 2.2.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
139
 
140
  == Changelog ==
141
 
142
+ = 2.2.16=
143
+ * 2020-04-16 - fix - accordion content editor issue fixed.
144
+
145
+
146
  = 2.2.15=
147
  * 2020-04-13 - fix - schema content convert quotes to characters,
148
  * 2020-04-13 - fix - schema count issue fixed when hide set to true.