Accordion - Version 2.2.7

Version Description

Download this release

Release Info

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

Code changes from version 2.2.6 to 2.2.7

includes/functions.php CHANGED
@@ -2,6 +2,51 @@
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  //add_filter('the_content','accordions_get_shortcode');
6
  function accordions_get_shortcode($content){
7
 
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
 
5
+ function accordions_old_content($post_id){
6
+
7
+ $accordions_content_title = get_post_meta( $post_id, 'accordions_content_title', true );
8
+ $accordions_content_title_toggled = get_post_meta( $post_id, 'accordions_content_title_toggled', true );
9
+ $accordions_content_body = get_post_meta( $post_id, 'accordions_content_body', true );
10
+ $accordions_hide = get_post_meta( $post_id, 'accordions_hide', true );
11
+ $accordions_section_icon_plus = get_post_meta( $post_id, 'accordions_section_icon_plus', true );
12
+ $accordions_section_icon_minus = get_post_meta( $post_id, 'accordions_section_icon_minus', true );
13
+ $accordions_active_accordion = get_post_meta( $post_id, 'accordions_active_accordion', true );
14
+
15
+ $accordions_data = array();
16
+
17
+ $i = 0;
18
+
19
+ if(!empty($accordions_content_title))
20
+ foreach ($accordions_content_title as $index => $item){
21
+
22
+
23
+ $accordions_data[$index]['header'] = $item;
24
+ $accordions_data[$index]['body'] = isset($accordions_content_body[$index]) ? $accordions_content_body[$index] : '';
25
+
26
+ $is_active = ($accordions_active_accordion == $i) ? array($i) : array();
27
+ $accordions_data[$index]['is_active'] = $is_active;
28
+ $accordions_data[$index]['toggled_text'] = isset($accordions_content_title_toggled[$index]) ? $accordions_content_title_toggled[$index] : '';
29
+
30
+ $active_icon = !empty($accordions_section_icon_plus[$index]) ? '<i class="fa '.$accordions_section_icon_plus[$index].'"></i>' : '';
31
+ $inactive_icon = !empty($accordions_section_icon_minus[$index]) ? '<i class="fa '.$accordions_section_icon_minus[$index].'"></i>' : '';
32
+
33
+
34
+
35
+ $accordions_data[$index]['active_icon'] = $active_icon;
36
+ $accordions_data[$index]['inactive_icon'] = $inactive_icon;
37
+ $accordions_data[$index]['hide'] = !empty($accordions_hide[$index]) ? 'yes' : 'no';
38
+
39
+
40
+ $i++;
41
+ }
42
+
43
+ return $accordions_data;
44
+
45
+ }
46
+
47
+
48
+
49
+
50
  //add_filter('the_content','accordions_get_shortcode');
51
  function accordions_get_shortcode($content){
52
 
templates/accordion/accordion-hook.php CHANGED
@@ -304,6 +304,17 @@ function accordions_main_items($atts){
304
  $icon_position = !empty($icon['position']) ? $icon['position'] : 'left';
305
 
306
  $active_plugins = get_option('active_plugins');
 
 
 
 
 
 
 
 
 
 
 
307
 
308
 
309
  $active_index = array();
304
  $icon_position = !empty($icon['position']) ? $icon['position'] : 'left';
305
 
306
  $active_plugins = get_option('active_plugins');
307
+ $accordions_plugin_info = get_option('accordions_plugin_info');
308
+ $accordions_upgrade = isset($accordions_plugin_info['accordions_upgrade']) ? $accordions_plugin_info['accordions_upgrade'] : '';
309
+
310
+
311
+
312
+
313
+ if($accordions_upgrade != 'done'){
314
+
315
+ $accordions_content = accordions_old_content($post_id);
316
+
317
+ }
318
 
319
 
320
  $active_index = array();