Accordion - Version 2.1.3

Version Description

  • 18/10/2018 - fix - minor php error fixed.
Download this release

Release Info

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

Code changes from version 2.1.2 to 2.1.3

accordions.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accordions
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.1.2
7
  WC requires at least: 3.0.0
8
  WC tested up to: 3.4
9
  Author: PickPlugins
@@ -101,28 +101,43 @@ class Accordions{
101
  }
102
 
103
  public function accordions_admin_scripts(){
104
-
105
- wp_enqueue_script('jquery');
106
- wp_enqueue_script('jquery-ui-sortable');
107
- wp_enqueue_script( 'jquery-ui-core' );
108
- wp_enqueue_script('jquery-ui-accordion');
109
- wp_enqueue_script('accordions_admin_js', plugins_url( 'assets/admin/js/scripts.js' , __FILE__ ) , array( 'jquery' ));
110
- wp_localize_script( 'accordions_admin_js', 'L10n_accordions', array(
111
- 'confirm_text' => __( 'Confirm', 'accordions' )
112
- ));
113
 
114
- wp_localize_script( 'accordions_admin_js', 'accordions_ajax', array( 'accordions_ajaxurl' => admin_url( 'admin-ajax.php')));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
 
116
 
 
117
 
118
- wp_enqueue_style('accordions_admin_style', plugins_url( 'assets/admin/css/style.css', __FILE__ ));
119
- wp_enqueue_style('fontawesome', plugins_url( 'assets/global/css/fontawesome.min.css', __FILE__ ));
120
 
121
- wp_enqueue_script('codemirror', plugins_url( 'assets/admin/js/codemirror.js' , __FILE__ ) , array( 'jquery' ));
122
- wp_enqueue_style('codemirror', plugins_url( 'assets/admin/css/codemirror.css', __FILE__ ));
123
 
124
- wp_enqueue_script('settings-tabs', plugins_url( 'assets/admin/js/settings-tabs.js' , __FILE__ ) , array( 'jquery' ));
125
- wp_enqueue_style('settings-tabs', plugins_url( 'assets/admin/css/settings-tabs.css', __FILE__ ));
126
 
127
 
128
  }
3
  Plugin Name: Accordions
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.1.3
7
  WC requires at least: 3.0.0
8
  WC tested up to: 3.4
9
  Author: PickPlugins
101
  }
102
 
103
  public function accordions_admin_scripts(){
 
 
 
 
 
 
 
 
 
104
 
105
+ global $post;
106
+
107
+ if( !empty($post) && $post->post_type=='accordions'){
108
+
109
+ wp_enqueue_editor();
110
+
111
+ wp_enqueue_script('jquery');
112
+ wp_enqueue_script('jquery-ui-sortable');
113
+ wp_enqueue_script( 'jquery-ui-core' );
114
+ wp_enqueue_script('jquery-ui-accordion');
115
+
116
+ wp_enqueue_script('wp-color-picker');
117
+ wp_enqueue_style( 'wp-color-picker' );
118
+
119
+ wp_enqueue_script('accordions_admin_js', plugins_url( 'assets/admin/js/scripts.js' , __FILE__ ) , array( 'jquery' ),'20181018');
120
+ wp_localize_script( 'accordions_admin_js', 'L10n_accordions', array(
121
+ 'confirm_text' => __( 'Confirm', 'accordions' )
122
+ ));
123
+
124
+ wp_localize_script( 'accordions_admin_js', 'accordions_ajax', array( 'accordions_ajaxurl' => admin_url( 'admin-ajax.php')));
125
+
126
+ wp_enqueue_style('accordions_admin_style', plugins_url( 'assets/admin/css/style.css', __FILE__ ),'','20181018');
127
+ wp_enqueue_style('fontawesome', plugins_url( 'assets/global/css/fontawesome.min.css', __FILE__ ),'','20181018');
128
+
129
+ wp_enqueue_script('codemirror', plugins_url( 'assets/admin/js/codemirror.js' , __FILE__ ) , array( 'jquery' ),'20181018');
130
+ wp_enqueue_style('codemirror', plugins_url( 'assets/admin/css/codemirror.css', __FILE__ ),'','20181018');
131
+
132
+ wp_enqueue_script('settings-tabs', plugins_url( 'assets/admin/js/settings-tabs.js' , __FILE__ ) , array( 'jquery' ),'20181018');
133
+ wp_enqueue_style('settings-tabs', plugins_url( 'assets/admin/css/settings-tabs.css', __FILE__ ),'','20181018');
134
 
135
+ // wp_enqueue_script( 'color-picker', plugins_url('/assets/admin/js/color-picker.js', __FILE__ ), array( 'wp-color-picker' ), true, true );
136
 
137
+ }
138
 
 
 
139
 
 
 
140
 
 
 
141
 
142
 
143
  }
assets/admin/js/settings-tabs.js CHANGED
@@ -1,26 +1,9 @@
1
  jQuery(document).ready(function($){
2
-
3
-
4
-
5
  $(document).on('click','.settings-tabs .tab-nav',function(){
6
-
7
  $(this).parent().parent().children('.tab-navs').children('.tab-nav').removeClass('active');
8
-
9
  $(this).addClass('active');
10
-
11
  id = $(this).attr('data-id');
12
-
13
- //console.log('Hello click');
14
- console.log(id);
15
-
16
  $(this).parent().parent().children('.tab-content').removeClass('active');
17
-
18
  $(this).parent().parent().children('.tab-content#'+id).addClass('active');
19
-
20
-
21
  })
22
-
23
-
24
-
25
-
26
  });
1
  jQuery(document).ready(function($){
 
 
 
2
  $(document).on('click','.settings-tabs .tab-nav',function(){
 
3
  $(this).parent().parent().children('.tab-navs').children('.tab-nav').removeClass('active');
 
4
  $(this).addClass('active');
 
5
  id = $(this).attr('data-id');
 
 
 
 
6
  $(this).parent().parent().children('.tab-content').removeClass('active');
 
7
  $(this).parent().parent().children('.tab-content#'+id).addClass('active');
 
 
8
  })
 
 
 
 
9
  });
assets/admin/js/settings-tabs.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){a(document).on("click",".settings-tabs .tab-nav",function(){a(this).parent().parent().children(".tab-navs").children(".tab-nav").removeClass("active");a(this).addClass("active");id=a(this).attr("data-id");console.log(id);a(this).parent().parent().children(".tab-content").removeClass("active");a(this).parent().parent().children(".tab-content#"+id).addClass("active")})});
1
+ jQuery(document).ready(function(a){a(document).on("click",".settings-tabs .tab-nav",function(){a(this).parent().parent().children(".tab-navs").children(".tab-nav").removeClass("active");a(this).addClass("active");id=a(this).attr("data-id");a(this).parent().parent().children(".tab-content").removeClass("active");a(this).parent().parent().children(".tab-content#"+id).addClass("active")})});
includes/functions-meta.php CHANGED
@@ -813,24 +813,12 @@ function settings_tabs_field_accordion_content($option, $post_id){
813
 
814
  $time = time();
815
 
816
- if(empty($accordions_content_title))
817
- {
818
- $accordions_content_title = array($time=>'Demo Title');
819
- }
820
- $i=0;
821
- foreach ($accordions_content_title as $accordions_key => $accordions_title)
822
- {
823
-
824
- if(empty($accordions_content_body[$accordions_key]))
825
- {
826
- $accordions_content_body[$accordions_key] = 'Demo Content';
827
- }
828
-
829
-
830
-
831
 
 
832
 
833
 
 
 
834
 
835
  ?>
836
 
@@ -886,54 +874,39 @@ function settings_tabs_field_accordion_content($option, $post_id){
886
  $i++;
887
  }
888
 
 
 
 
 
 
 
 
889
  ?>
890
 
891
  </div>
892
 
 
893
  <script>
894
- jQuery(document).ready(function($)
895
- {
896
  $(function() {
897
  $( "#accordions-content" ).sortable({ handle: '.move' });
898
- //$( ".items-container" ).disableSelection();
899
- });
900
-
901
- // to add editor on textarea
902
- tinyMCE.init({
903
- mode : "none",
904
- statusbar: false,
905
- menubar: false,
906
- statusbar: true,
907
- setup: function (editor) {
908
- editor.on('change', function () {
909
- editor.save();
910
- });
911
-
912
- },
913
  });
914
-
915
-
916
-
917
- $(document).on('click', '.accordions-content-buttons .add-accordions', function()
918
- {
919
-
920
  var unique_key = $.now();
921
-
922
  $("#accordions_metabox .accordions-content").append('<div class="items" valign="top"><div class="section-header"><span class="move"><i class="fa fa-bars"></i></span><span class="expand-compress"><i class="fa fa-expand"></i><i class="fa fa-compress"></i></span><div class="accordions-title-preview">Demo Title #'+unique_key+'</div><span class="removeaccordions">Remove</span><label class="switch"><input type="checkbox" value="1" name="accordions_hide['+unique_key+']">Hide on Frontend</label></div><div class="section-panel"><strong><?php _e('Header text','accordions'); ?></strong> <br><input style="width:80%" placeholder="<?php echo __('Accordion header text', 'accordions'); ?>" type="text" name="accordions_content_title['+unique_key+']" value="" /><br> <br><strong><?php _e('Content', 'accordions'); ?></strong> <br><textarea class="accordion-content-textarea" id="content-'+unique_key+'" placeholder="Accordion content" name="accordions_content_body['+unique_key+']" ></textarea></div></div>');
923
-
924
- //alert(unique_key);
925
-
926
-
927
- tinyMCE.execCommand('mceAddEditor', false, 'content-'+unique_key);
928
-
 
929
  })
930
-
931
  })
932
-
933
  </script>
934
 
935
 
936
- <p class="description"><?php if(!empty($details)) echo $details; ?></p>
937
  </div>
938
  </div>
939
 
813
 
814
  $time = time();
815
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
816
 
817
+ $i=0;
818
 
819
 
820
+ if(!empty($accordions_content_title)):
821
+ foreach ($accordions_content_title as $accordions_key => $accordions_title){
822
 
823
  ?>
824
 
874
  $i++;
875
  }
876
 
877
+ else:
878
+ ?>
879
+ <div class="items"><?php echo __('Click "Add" button to add your accordion content', 'accordions'); ?></div>
880
+ <?php
881
+
882
+ endif;
883
+
884
  ?>
885
 
886
  </div>
887
 
888
+
889
  <script>
890
+ jQuery(document).ready(function($){
 
891
  $(function() {
892
  $( "#accordions-content" ).sortable({ handle: '.move' });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
  });
894
+ $(document).on('click', '.accordions-content-buttons .add-accordions', function(){
 
 
 
 
 
895
  var unique_key = $.now();
 
896
  $("#accordions_metabox .accordions-content").append('<div class="items" valign="top"><div class="section-header"><span class="move"><i class="fa fa-bars"></i></span><span class="expand-compress"><i class="fa fa-expand"></i><i class="fa fa-compress"></i></span><div class="accordions-title-preview">Demo Title #'+unique_key+'</div><span class="removeaccordions">Remove</span><label class="switch"><input type="checkbox" value="1" name="accordions_hide['+unique_key+']">Hide on Frontend</label></div><div class="section-panel"><strong><?php _e('Header text','accordions'); ?></strong> <br><input style="width:80%" placeholder="<?php echo __('Accordion header text', 'accordions'); ?>" type="text" name="accordions_content_title['+unique_key+']" value="" /><br> <br><strong><?php _e('Content', 'accordions'); ?></strong> <br><textarea class="accordion-content-textarea" id="content-'+unique_key+'" placeholder="Accordion content" name="accordions_content_body['+unique_key+']" ></textarea></div></div>');
897
+ wp.editor.initialize( 'content-'+unique_key, {
898
+ mediaButtons: true,
899
+ tinymce: {
900
+ toolbar1: 'bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,undo,redo'
901
+ },
902
+ quicktags: true,
903
+ } );
904
  })
 
905
  })
 
906
  </script>
907
 
908
 
909
+
910
  </div>
911
  </div>
912
 
includes/meta-new.php CHANGED
@@ -75,6 +75,7 @@ function meta_boxes_accordions_product_input( $post ) {
75
  $accordions_id = get_post_meta( $post->ID, 'accordions_id', true );
76
  $accordions_tab_title = get_post_meta( $post->ID, 'accordions_tab_title', true );
77
 
 
78
  //var_dump($accordions_id);
79
  ?>
80
 
@@ -413,8 +414,8 @@ function meta_boxes_accordions_save( $post_id ) {
413
  $accordions_items_content_padding = sanitize_text_field( $_POST['accordions_items_content_padding'] );
414
  $accordions_items_content_margin = sanitize_text_field( $_POST['accordions_items_content_margin'] );
415
 
416
- $accordions_content_title = stripslashes_deep( $_POST['accordions_content_title'] );
417
- $accordions_content_body = stripslashes_deep( $_POST['accordions_content_body'] );
418
 
419
 
420
 
75
  $accordions_id = get_post_meta( $post->ID, 'accordions_id', true );
76
  $accordions_tab_title = get_post_meta( $post->ID, 'accordions_tab_title', true );
77
 
78
+
79
  //var_dump($accordions_id);
80
  ?>
81
 
414
  $accordions_items_content_padding = sanitize_text_field( $_POST['accordions_items_content_padding'] );
415
  $accordions_items_content_margin = sanitize_text_field( $_POST['accordions_items_content_margin'] );
416
 
417
+ $accordions_content_title = isset($_POST['accordions_content_title']) ? stripslashes_deep( $_POST['accordions_content_title'] ) : array();
418
+ $accordions_content_body = isset($_POST['accordions_content_body']) ? stripslashes_deep( $_POST['accordions_content_body'] ) : array();
419
 
420
 
421
 
readme.txt CHANGED
@@ -4,7 +4,7 @@
4
  Tags: accordion, accordions, Responsive accordions, accordions plugin, jQuery accordions, accordions short-code, accordions Widget, accordions plugin wordpress, accordions plugin jquery, tabs, jquery tabs, tab, responsive tabs
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
- Stable tag: 2.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -92,6 +92,9 @@ then paste this shortcode anywhere in your page to display accordions<br />
92
 
93
  == Changelog ==
94
 
 
 
 
95
  = 2.1.2 =
96
  * 10/10/2018 - fix - Icon not saved issue fixed.
97
 
4
  Tags: accordion, accordions, Responsive accordions, accordions plugin, jQuery accordions, accordions short-code, accordions Widget, accordions plugin wordpress, accordions plugin jquery, tabs, jquery tabs, tab, responsive tabs
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
+ Stable tag: 2.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
92
 
93
  == Changelog ==
94
 
95
+ = 2.1.3 =
96
+ * 18/10/2018 - fix - minor php error fixed.
97
+
98
  = 2.1.2 =
99
  * 10/10/2018 - fix - Icon not saved issue fixed.
100
 
templates/accordion/accordion.php CHANGED
@@ -49,6 +49,6 @@ include accordions_plugin_dir.'/templates/accordion/accordion-edit.php';
49
 
50
 
51
  ?>
52
- <link rel="stylesheet" type="text/css" media="all" href="<?php echo accordions_plugin_url; ?>assets/frontend/css/jquery-ui.css"/>
53
- <link rel="stylesheet" type="text/css" media="all" href="<?php echo accordions_plugin_url; ?>assets/global/css/themes.style.css"/>
54
- <link rel="stylesheet" type="text/css" media="all" href="<?php echo accordions_plugin_url; ?>assets/global/css/fontawesome.min.css"/>
49
 
50
 
51
  ?>
52
+ <link rel="stylesheet" type="text/css" media="all" href="<?php echo accordions_plugin_url; ?>assets/frontend/css/jquery-ui.css?ver=20181018"/>
53
+ <link rel="stylesheet" type="text/css" media="all" href="<?php echo accordions_plugin_url; ?>assets/global/css/themes.style.css?ver=20181018"/>
54
+ <link rel="stylesheet" type="text/css" media="all" href="<?php echo accordions_plugin_url; ?>assets/global/css/fontawesome.min.css?ver=20181018"/>
templates/accordion/lazy.php CHANGED
@@ -7,14 +7,17 @@
7
 
8
  if ( ! defined('ABSPATH')) exit; // if direct access
9
 
10
- if($accordions_lazy_load=='yes'){
11
-
12
  ?>
13
- <p id="accordions-lazy-<?php echo $post_id; ?>" class="accordions-lazy"><img src="<?php echo $accordions_lazy_load_src; ?>" /></p>
 
 
 
 
14
  <script>
15
  jQuery( window ).load(function() {
16
  jQuery('#accordions-lazy-<?php echo $post_id; ?>').fadeOut();
17
  jQuery('#accordions-<?php echo $post_id; ?>').fadeIn();
18
  });</script>
19
  <?php
20
- }
7
 
8
  if ( ! defined('ABSPATH')) exit; // if direct access
9
 
10
+ if($accordions_lazy_load=='yes'):
 
11
  ?>
12
+ <p id="accordions-lazy-<?php echo $post_id; ?>" class="accordions-lazy">
13
+ <?php if(!empty($accordions_lazy_load_src)):?>
14
+ <img src="<?php echo $accordions_lazy_load_src; ?>" />
15
+ <?php endif;?>
16
+ </p>
17
  <script>
18
  jQuery( window ).load(function() {
19
  jQuery('#accordions-lazy-<?php echo $post_id; ?>').fadeOut();
20
  jQuery('#accordions-<?php echo $post_id; ?>').fadeIn();
21
  });</script>
22
  <?php
23
+ endif;
templates/accordion/variables.php CHANGED
@@ -37,8 +37,6 @@ $accordions_lazy_load = get_post_meta( $post_id, 'accordions_lazy_load', true );
37
  if(empty($accordions_lazy_load)){$accordions_lazy_load = 'yes';}
38
 
39
  $accordions_lazy_load_src = get_post_meta( $post_id, 'accordions_lazy_load_src', true );
40
- if(empty($accordions_lazy_load_src)){$accordions_lazy_load_src = accordions_plugin_url.'assets/frontend/gif/ajax-loader-1.gif';}
41
-
42
 
43
  $accordions_animate_style = get_post_meta( $post_id, 'accordions_animate_style', true );
44
  if(empty($accordions_animate_style)){$accordions_animate_style = 'swing';}
37
  if(empty($accordions_lazy_load)){$accordions_lazy_load = 'yes';}
38
 
39
  $accordions_lazy_load_src = get_post_meta( $post_id, 'accordions_lazy_load_src', true );
 
 
40
 
41
  $accordions_animate_style = get_post_meta( $post_id, 'accordions_animate_style', true );
42
  if(empty($accordions_animate_style)){$accordions_animate_style = 'swing';}
templates/tabs/tabs-lazy.php CHANGED
@@ -7,13 +7,15 @@
7
 
8
  if ( ! defined('ABSPATH')) exit; // if direct access
9
 
10
- if($accordions_lazy_load=='yes'){
11
-
12
- $html.= '<p id="accordions-tabs-lazy-'.$post_id.'" class="accordions-tabs-lazy"><img src="'.$accordions_lazy_load_src.'"/></p>';
13
-
14
- $html .= "<script>jQuery( window ).load(function() {
15
- jQuery('#accordions-tabs-lazy-".$post_id."').fadeOut();
16
- jQuery('#accordions-tabs-".$post_id."').fadeIn();
17
- });</script>";
18
-
19
- }
 
 
7
 
8
  if ( ! defined('ABSPATH')) exit; // if direct access
9
 
10
+ if($accordions_lazy_load=='yes' && !empty($accordions_lazy_load_src)){
11
+
12
+ $html.= '<p id="accordions-tabs-lazy-'.$post_id.'" class="accordions-tabs-lazy">
13
+ <img src="'.$accordions_lazy_load_src.'"/>
14
+ </p>';
15
+
16
+ $html .= "<script>jQuery( window ).load(function() {
17
+ jQuery('#accordions-tabs-lazy-".$post_id."').fadeOut();
18
+ jQuery('#accordions-tabs-".$post_id."').fadeIn();
19
+ });</script>";
20
+
21
+ }
templates/tabs/variables.php CHANGED
@@ -40,7 +40,7 @@ if ( ! defined('ABSPATH')) exit; // if direct access
40
  if(empty($accordions_lazy_load)){$accordions_lazy_load = 'yes';}
41
 
42
  $accordions_lazy_load_src = get_post_meta( $post_id, 'accordions_lazy_load_src', true );
43
- if(empty($accordions_lazy_load_src)){$accordions_lazy_load_src = accordions_plugin_url.'assets/frontend/gif/ajax-loader-1.gif';}
44
 
45
 
46
  $accordions_animate_style = get_post_meta( $post_id, 'accordions_animate_style', true );
40
  if(empty($accordions_lazy_load)){$accordions_lazy_load = 'yes';}
41
 
42
  $accordions_lazy_load_src = get_post_meta( $post_id, 'accordions_lazy_load_src', true );
43
+
44
 
45
 
46
  $accordions_animate_style = get_post_meta( $post_id, 'accordions_animate_style', true );