Accordion - Version 2.0.23

Version Description

  • 12/02/2018 - add - Accordion export/import feature added
Download this release

Release Info

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

Code changes from version 2.0.22 to 2.0.23

accordions.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /*
3
  Plugin Name: Accordions
4
- Plugin URI: http://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/
5
  Description: Fully responsive and mobile ready accordion grid for WordPress.
6
- Version: 2.0.22
7
- Author: pickplugins
8
  Author URI: http://pickplugins.com
9
  Text Domain: accordions
10
  License: GPLv2 or later
@@ -22,12 +22,12 @@ class Accordions{
22
  define('accordions_plugin_dir', plugin_dir_path( __FILE__ ) );
23
  define('accordions_wp_url', 'https://wordpress.org/plugins/accordions/' );
24
  define('accordions_wp_reviews', 'http://wordpress.org/support/view/plugin-reviews/accordions' );
25
- define('accordions_pro_url','https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress//?ref=dashboard' );
26
  define('accordions_demo_url', 'http://pickplugins.com' );
27
  define('accordions_conatct_url', 'https://www.pickplugins.com/contact/' );
28
  define('accordions_qa_url', 'https://www.pickplugins.com/support/' );
29
  define('accordions_plugin_name', 'Accordions' );
30
- define('accordions_plugin_version', '2.0.22' );
31
  define('accordions_customer_type', 'free' );
32
  define('accordions_share_url', 'https://wordpress.org/plugins/accordions/' );
33
  define('accordions_tutorial_video_url', '//www.youtube.com/embed/h2wNFJaaY8s?rel=0' );
@@ -105,6 +105,7 @@ class Accordions{
105
  'confirm_text' => __( 'Confirm', 'accordions' )
106
  ));
107
 
 
108
 
109
  wp_enqueue_style('accordions_admin_style', plugins_url( 'assets/admin/css/style.css', __FILE__ ));
110
  wp_enqueue_style('font-awesome', plugins_url( 'assets/global/css/font-awesome.min.css', __FILE__ ));
1
  <?php
2
  /*
3
  Plugin Name: Accordions
4
+ Plugin URI: http://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.0.23
7
+ Author: PickPlugins
8
  Author URI: http://pickplugins.com
9
  Text Domain: accordions
10
  License: GPLv2 or later
22
  define('accordions_plugin_dir', plugin_dir_path( __FILE__ ) );
23
  define('accordions_wp_url', 'https://wordpress.org/plugins/accordions/' );
24
  define('accordions_wp_reviews', 'http://wordpress.org/support/view/plugin-reviews/accordions' );
25
+ define('accordions_pro_url','https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard' );
26
  define('accordions_demo_url', 'http://pickplugins.com' );
27
  define('accordions_conatct_url', 'https://www.pickplugins.com/contact/' );
28
  define('accordions_qa_url', 'https://www.pickplugins.com/support/' );
29
  define('accordions_plugin_name', 'Accordions' );
30
+ define('accordions_plugin_version', '2.0.23' );
31
  define('accordions_customer_type', 'free' );
32
  define('accordions_share_url', 'https://wordpress.org/plugins/accordions/' );
33
  define('accordions_tutorial_video_url', '//www.youtube.com/embed/h2wNFJaaY8s?rel=0' );
105
  'confirm_text' => __( 'Confirm', 'accordions' )
106
  ));
107
 
108
+ wp_localize_script( 'accordions_admin_js', 'accordions_ajax', array( 'accordions_ajaxurl' => admin_url( 'admin-ajax.php')));
109
 
110
  wp_enqueue_style('accordions_admin_style', plugins_url( 'assets/admin/css/style.css', __FILE__ ));
111
  wp_enqueue_style('font-awesome', plugins_url( 'assets/global/css/font-awesome.min.css', __FILE__ ));
assets/admin/js/scripts.js CHANGED
@@ -4,6 +4,40 @@ jQuery(document).ready(function($)
4
  $('.accordions-tooltip').tooltipster();
5
 
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  $(document).on('click', '#accordions_metabox .reset-active', function()
8
  {
9
 
4
  $('.accordions-tooltip').tooltipster();
5
 
6
 
7
+
8
+ $(document).on('click','.import-json',function(){
9
+
10
+ json_file = $('.json_file').val();
11
+
12
+
13
+
14
+ $.ajax(
15
+ {
16
+ type: 'POST',
17
+ context: this,
18
+ url:accordions_ajax.accordions_ajaxurl,
19
+ data: {
20
+ "action" : "accordions_ajax_import_json",
21
+ "json_file" : json_file,
22
+
23
+ },
24
+ success: function( response ) {
25
+
26
+ var data = JSON.parse( response );
27
+ json_file = data['json_file'];
28
+ console.log(data);
29
+
30
+
31
+ } });
32
+
33
+ })
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
  $(document).on('click', '#accordions_metabox .reset-active', function()
42
  {
43
 
includes/class-settings.php CHANGED
@@ -22,14 +22,17 @@ class class_accordions_settings{
22
  include('menu/help.php');
23
  }
24
 
25
-
 
 
26
 
27
 
28
 
29
  public function accordions_menu_init(){
30
 
31
  add_submenu_page('edit.php?post_type=accordions', __('Help & Contact','accordions'), __('Help & Contact','accordions'), 'manage_options', 'accordions_paratheme_menu_help', array( $this, 'accordions_help' ));
32
-
 
33
 
34
  }
35
 
22
  include('menu/help.php');
23
  }
24
 
25
+ public function export_import(){
26
+ include('menu/export-import.php');
27
+ }
28
 
29
 
30
 
31
  public function accordions_menu_init(){
32
 
33
  add_submenu_page('edit.php?post_type=accordions', __('Help & Contact','accordions'), __('Help & Contact','accordions'), 'manage_options', 'accordions_paratheme_menu_help', array( $this, 'accordions_help' ));
34
+
35
+ add_submenu_page('edit.php?post_type=accordions', __('Export import', 'accordions'), __('Export-import', 'accordions'), 'manage_options', 'export_import', array( $this, 'export_import' ));
36
 
37
  }
38
 
includes/functions.php CHANGED
@@ -10,6 +10,55 @@ if ( ! defined('ABSPATH')) exit; // if direct access
10
 
11
 
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
 
15
 
10
 
11
 
12
 
13
+ function accordions_ajax_import_json(){
14
+
15
+ $response = array();
16
+ $json_file = isset($_POST['json_file']) ? $_POST['json_file'] : '';
17
+ $string = file_get_contents($json_file);
18
+ $json_a = json_decode($string,true);
19
+
20
+
21
+ foreach ($json_a as $post_id=>$post_data){
22
+
23
+ $meta_fields = $post_data['meta_fields'];
24
+ $title = $post_data['title'];
25
+
26
+ // Create post object
27
+ $my_post = array(
28
+ 'post_title' => $title,
29
+ 'post_type' => 'accordions',
30
+ 'post_status' => 'publish',
31
+
32
+ );
33
+
34
+ $post_inserted_id = wp_insert_post( $my_post );
35
+
36
+ foreach ($meta_fields as $meta_key=>$meta_value){
37
+ update_post_meta( $post_inserted_id, $meta_key, $meta_value );
38
+ }
39
+
40
+
41
+
42
+
43
+ }
44
+
45
+
46
+ $response['json_a'] = $json_a;
47
+ //$response['string'] = $string;
48
+ //$response['json_file'] = $json_file;
49
+
50
+
51
+
52
+
53
+ echo json_encode( $response );
54
+
55
+
56
+
57
+ die();
58
+ }
59
+ add_action('wp_ajax_accordions_ajax_import_json', 'accordions_ajax_import_json');
60
+ //add_action('wp_ajax_nopriv_accordions_ajax_import_json', 'accordions_ajax_import_json');
61
+
62
 
63
 
64
 
includes/menu/export-import.php ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * @Author pickplugins
5
+ * Copyright: 2015 pickplugins
6
+ */
7
+
8
+ if ( ! defined('ABSPATH')) exit; // if direct access
9
+
10
+
11
+
12
+
13
+
14
+ if(empty($_POST['accordions_hidden']))
15
+ {
16
+
17
+
18
+
19
+ }
20
+ else
21
+ {
22
+ $nonce = $_POST['_wpnonce'];
23
+
24
+ if(wp_verify_nonce( $nonce, 'accordions_import' ) && $_POST['accordions_hidden'] == 'Y') {
25
+
26
+
27
+
28
+
29
+
30
+ ?>
31
+
32
+ <div class="updated"><p><strong><?php _e('Changes Saved.', 'accordions' ); ?></strong></p></div>
33
+ <pre><?php echo var_export($_POST, true);?></pre>
34
+ <?php
35
+ }
36
+ }
37
+
38
+
39
+
40
+
41
+
42
+
43
+ ?>
44
+
45
+
46
+
47
+ <div class="wrap">
48
+ <h2><?php echo accordions_plugin_name ." ".__('Export/import','accordions');?>
49
+ </h2>
50
+ <br />
51
+
52
+ <form method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
53
+ <input type="hidden" name="accordions_hidden" value="Y">
54
+
55
+
56
+
57
+ <div class="para-settings accordions-admin">
58
+ <ul class="tab-nav">
59
+ <li nav="1" class="nav1 active"><i class="fa fa-hand-o-right"></i> <?php _e('Export','accordions'); ?></li>
60
+ <li nav="2" class="nav2"><i class="fa fa-hand-o-right"></i> <?php _e('Import','accordions'); ?></li>
61
+
62
+ </ul> <!-- tab-nav end -->
63
+
64
+ <ul class="box">
65
+
66
+ <li style="display: block;" class="box1 tab-box active">
67
+
68
+
69
+
70
+
71
+ <div class="option-box">
72
+ <p class="option-title"><?php _e('Export','accordions'); ?></p>
73
+ <p class="option-info"></p>
74
+
75
+ <?php
76
+
77
+
78
+ $meta_fields = array(
79
+ 'accordions_collapsible',
80
+ 'accordions_expaned_other',
81
+ 'accordions_heightStyle',
82
+ 'accordions_active_accordion',
83
+ 'accordions_click_scroll_top',
84
+ 'accordions_header_toggle',
85
+ 'accordions_click_scroll_top_offset',
86
+ 'accordions_active_event',
87
+ 'accordions_lazy_load',
88
+ 'accordions_lazy_load_src',
89
+ 'accordions_animate_style',
90
+ 'accordions_animate_delay',
91
+ 'accordions_hide_edit',
92
+ 'accordions_expand_collapse_display',
93
+ 'accordions_child',
94
+ 'accordions_container_padding',
95
+ 'accordions_container_bg_color',
96
+ 'accordions_container_text_align',
97
+ 'accordions_bg_img',
98
+ 'accordions_themes',
99
+ 'accordions_icons_plus',
100
+ 'accordions_icons_minus',
101
+ 'accordions_section_icon_plus',
102
+ 'accordions_section_icon_minus',
103
+ 'accordions_icons_color',
104
+ 'accordions_icons_color_hover',
105
+ 'accordions_icons_font_size',
106
+ 'accordions_icons_position',
107
+ 'accordions_default_bg_color',
108
+ 'accordions_active_bg_color',
109
+ 'accordions_header_bg_opacity',
110
+ 'accordions_bg_color',
111
+ 'accordions_header_bg_img',
112
+ 'accordions_items_title_color',
113
+ 'accordions_items_title_color_hover',
114
+ 'accordions_items_title_font_family',
115
+ 'accordions_items_title_font_size',
116
+ 'accordions_items_title_margin',
117
+ 'accordions_items_title_padding',
118
+ 'accordions_items_content_color',
119
+ 'accordions_items_content_font_family',
120
+ 'accordions_items_content_font_size',
121
+ 'accordions_items_content_bg_color',
122
+ 'accordions_items_content_bg_opacity',
123
+ 'accordions_items_content_padding',
124
+ 'accordions_items_content_margin',
125
+ 'accordions_content_title',
126
+ 'accordions_content_title_toogled',
127
+ 'accordions_content_body',
128
+ 'accordions_hide',
129
+ 'accordions_custom_css',
130
+ 'accordions_tabs_collapsible',
131
+ 'accordions_tabs_active_event',
132
+ 'accordions_tabs_vertical',
133
+ 'accordions_tabs_icon_toggle',
134
+ 'accordions_click_track',
135
+ 'track_header',
136
+ );
137
+
138
+
139
+ $wp_query = new WP_Query( array (
140
+ 'post_type' => 'accordions',
141
+ 'post_status' => 'publish',
142
+
143
+ ));
144
+
145
+ if ( $wp_query->have_posts() ) :
146
+ while ( $wp_query->have_posts() ) : $wp_query->the_post();
147
+ foreach($meta_fields as $field){
148
+ $fields_data[$field] = get_post_meta(get_the_ID(),$field, true);
149
+ }
150
+
151
+ $post_data_exported[get_the_ID()] = array(
152
+ 'title'=>get_the_title(),
153
+ 'meta_fields'=>$fields_data,
154
+ );
155
+
156
+
157
+ endwhile;
158
+ wp_reset_query();
159
+ else:
160
+
161
+ echo __('Not found');
162
+
163
+ endif;
164
+
165
+ $post_data_exported_json = json_encode($post_data_exported);
166
+
167
+
168
+ ?>
169
+
170
+ <pre><?php //echo var_export($post_data_exported_json, true);?></pre>
171
+
172
+
173
+ <pre><?php //echo var_export(json_decode($post_data_exported_json), true);?></pre>
174
+
175
+
176
+ <?php
177
+
178
+ // $upload_dir = wp_upload_dir();
179
+ // $basedir = $upload_dir['basedir'];
180
+ // $baseurl = $upload_dir['baseurl'];
181
+ // $export_layout_content_dir = $basedir.'/accordions';
182
+ //
183
+ // if ( ! file_exists( $export_layout_content_dir ) ) {
184
+ // wp_mkdir_p( $export_layout_content_dir );
185
+ // }
186
+ //
187
+ //
188
+ // $layout_content_file = fopen($export_layout_content_dir."/export-".date('Y-m-d-h').'-'.time().".txt", "w");
189
+ //
190
+ //
191
+ // fwrite($layout_content_file, $post_data_exported_json);
192
+ //
193
+ // $file_url = $baseurl."/accordions/export-".date('Y-m-d-h').'-'.time().".txt";
194
+ // $file_dir = $basedir."/accordions/export-".date('Y-m-d-h').'-'.time().".txt";
195
+ // //$file_url = post_grid_plugin_url."export/export-layout-content-".date('Y-m-d-h').'-'.time().".txt";
196
+ //
197
+ // echo $file_url;
198
+ // echo '<br/>';
199
+ // //echo $file_dir;
200
+ //
201
+ //
202
+ // fclose($layout_content_file);
203
+
204
+ ?>
205
+
206
+ <br>
207
+ <textarea style="width: 80%" id="text-val" rows="4"><?php echo $post_data_exported_json; ?></textarea><br/><br>
208
+ <input type="button" class="button" id="dwn-btn" value="Download json"/>
209
+
210
+ <script>
211
+ function download(filename, text) {
212
+ var element = document.createElement('a');
213
+ element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
214
+ element.setAttribute('download', filename);
215
+
216
+ element.style.display = 'none';
217
+ document.body.appendChild(element);
218
+
219
+ element.click();
220
+
221
+ document.body.removeChild(element);
222
+ }
223
+
224
+ // Start file download.
225
+ document.getElementById("dwn-btn").addEventListener("click", function(){
226
+ // Generate download of hello.txt file with some content
227
+ var text = document.getElementById("text-val").value;
228
+ var filename = "<?php echo date('Y-m-d-h').'-'.time(); ?>.txt";
229
+
230
+ download(filename, text);
231
+ }, false);
232
+ </script>
233
+
234
+
235
+
236
+ </div>
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+ </li>
245
+ <li style="display: none;" class="box2 tab-box">
246
+
247
+ <div class="option-box">
248
+ <p class="option-title"><?php _e('Import','accordions'); ?></p>
249
+ <p class="option-info"></p>
250
+
251
+ <input placeholder="json file url" type="text" class="json_file" name="json_file" value="">
252
+ <div class="import-json button">Import</div>
253
+ </div>
254
+
255
+
256
+ </li>
257
+
258
+ </div>
259
+
260
+ </form>
261
+ </div> <!-- wrap end -->
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Accordion ===
2
- Contributors: pickplugins
3
- Donate link: http://pickplugins.com
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.0.22
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -18,8 +18,9 @@ Accordion content create wasn't easy before, you will really love how its works
18
  ### Accordions by http://pickplugins.com
19
 
20
  * [Accordions - Premium &raquo;](https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=wordpress.org)
21
- * [Support &raquo;](http://www.pickplugins.com/questions/?ref=wordpress.org)
22
- * [Documentation &raquo;](https://pickplugins.com/docs/documentation/accordions/?ref=wordpress.org)
 
23
 
24
 
25
  <strong>Plugin Features</strong><br />
@@ -91,6 +92,9 @@ then paste this shortcode anywhere in your page to display accordions<br />
91
 
92
  == Changelog ==
93
 
 
 
 
94
 
95
  = 2.0.22 =
96
  * 12/02/2018 - fix - CSS conflict issue fixed on accoridon edit tabs.
1
  === Accordion ===
2
+ Contributors: PickPlugins
3
+ Donate link: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
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.0.23
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
18
  ### Accordions by http://pickplugins.com
19
 
20
  * [Accordions - Premium &raquo;](https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=wordpress.org)
21
+ * [Live Demo &raquo;](https://www.pickplugins.com/demo/accordions/?ref=wordpress.org)
22
+ * [Support &raquo;](https://www.pickplugins.com/support/?ref=wordpress.org)
23
+ * [Documentation &raquo;](https://www.pickplugins.com/documentation/accordions/?ref=wordpress.org)
24
 
25
 
26
  <strong>Plugin Features</strong><br />
92
 
93
  == Changelog ==
94
 
95
+ = 2.0.23 =
96
+ * 12/02/2018 - add - Accordion export/import feature added
97
+
98
 
99
  = 2.0.22 =
100
  * 12/02/2018 - fix - CSS conflict issue fixed on accoridon edit tabs.