Version Description
- 2020-03-17 - add - 20 3rd party plugin to import accordion and tabs data.
Download this release
Release Info
Developer | pickplugins |
Plugin | Accordion |
Version | 2.2.5 |
Comparing to | |
See all releases |
Code changes from version 2.2.4 to 2.2.5
- accordions.php +20 -8
- includes/3rd-party/accordion-shortcodes/functions-data-import.php +184 -0
- includes/3rd-party/arconix-faq/functions-data-import.php +103 -91
- includes/3rd-party/easy-responsive-tabs/functions-data-import.php +219 -0
- includes/3rd-party/everest-tab-lite/functions-data-import.php +222 -0
- includes/3rd-party/helpie-faq/functions-data-import.php +182 -0
- includes/3rd-party/meks-flexible-shortcodes/functions-data-import.php +236 -0
- includes/3rd-party/quick-and-easy-faqs/functions-data-import.php +182 -0
- includes/3rd-party/responsive-accordion-and-collapse/functions-data-import.php +4 -4
- includes/3rd-party/shortcodes-ultimate/functions-data-import.php +236 -0
- includes/3rd-party/sp-faq/functions-data-import.php +182 -0
- includes/3rd-party/squelch-tabs-and-accordions-shortcodes/functions-data-import.php +285 -0
- includes/3rd-party/tabby-responsive-tabs/functions-data-import.php +74 -92
- includes/3rd-party/tabs-pro/functions-data-import.php +187 -0
- includes/3rd-party/tabs-shortcode/functions-data-import.php +184 -0
- includes/3rd-party/ultimate-faqs/functions-data-import.php +182 -0
- includes/3rd-party/wc-shortcodes/functions-data-import.php +236 -0
- includes/3rd-party/wonderplugin-tabs-trial/functions-data-import.php +167 -0
- includes/3rd-party/wp-shortcode/functions-data-import.php +188 -0
- includes/class-settings-hook.php +226 -8
- includes/functions.php +117 -0
- readme.txt +8 -1
- templates/accordion/accordion-hook.php +2 -2
- templates/tabs/tabs-hook.php +1 -1
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.
|
7 |
WC requires at least: 3.0.0
|
8 |
WC tested up to: 3.6
|
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.
|
27 |
define('accordions_plugin_name', 'Accordions' );
|
28 |
define('accordions_plugin_basename', plugin_basename( __FILE__ ) );
|
29 |
|
@@ -57,15 +57,27 @@ class Accordions{
|
|
57 |
require_once( accordions_plugin_dir . 'templates/accordion/accordion-hook.php');
|
58 |
require_once( accordions_plugin_dir . 'templates/tabs/tabs-hook.php');
|
59 |
|
60 |
-
|
61 |
require_once( accordions_plugin_dir . 'includes/3rd-party/easy-accordion-free/functions-data-import.php');
|
62 |
require_once( accordions_plugin_dir . 'includes/3rd-party/responsive-accordion-and-collapse/functions-data-import.php');
|
63 |
require_once( accordions_plugin_dir . 'includes/3rd-party/responsive-tabs/functions-data-import.php');
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
|
71 |
|
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.5
|
7 |
WC requires at least: 3.0.0
|
8 |
WC tested up to: 3.6
|
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.5' );
|
27 |
define('accordions_plugin_name', 'Accordions' );
|
28 |
define('accordions_plugin_basename', plugin_basename( __FILE__ ) );
|
29 |
|
57 |
require_once( accordions_plugin_dir . 'templates/accordion/accordion-hook.php');
|
58 |
require_once( accordions_plugin_dir . 'templates/tabs/tabs-hook.php');
|
59 |
|
60 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/arconix-faq/functions-data-import.php');
|
61 |
require_once( accordions_plugin_dir . 'includes/3rd-party/easy-accordion-free/functions-data-import.php');
|
62 |
require_once( accordions_plugin_dir . 'includes/3rd-party/responsive-accordion-and-collapse/functions-data-import.php');
|
63 |
require_once( accordions_plugin_dir . 'includes/3rd-party/responsive-tabs/functions-data-import.php');
|
64 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/easy-responsive-tabs/functions-data-import.php');
|
65 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/everest-tab-lite/functions-data-import.php');
|
66 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/quick-and-easy-faqs/functions-data-import.php');
|
67 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/shortcodes-ultimate/functions-data-import.php');
|
68 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/sp-faq/functions-data-import.php');
|
69 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/squelch-tabs-and-accordions-shortcodes/functions-data-import.php');
|
70 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/tabby-responsive-tabs/functions-data-import.php');
|
71 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/ultimate-faqs/functions-data-import.php');
|
72 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/tabs-shortcode/functions-data-import.php');
|
73 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/wonderplugin-tabs-trial/functions-data-import.php');
|
74 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/tabs-pro/functions-data-import.php');
|
75 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/accordion-shortcodes/functions-data-import.php');
|
76 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/wc-shortcodes/functions-data-import.php');
|
77 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/wp-shortcode/functions-data-import.php');
|
78 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/helpie-faq/functions-data-import.php');
|
79 |
+
require_once( accordions_plugin_dir . 'includes/3rd-party/meks-flexible-shortcodes/functions-data-import.php');
|
80 |
+
|
81 |
|
82 |
|
83 |
|
includes/3rd-party/accordion-shortcodes/functions-data-import.php
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_accordion_shortcodes', 'accordions_import_cron_accordion_shortcodes');
|
10 |
+
add_action('accordions_import_cron_accordion_shortcodes', 'accordions_import_cron_accordion_shortcodes');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_accordion_shortcodes(){
|
14 |
+
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=> array( 'page', ),
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 10,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
41 |
+
|
42 |
+
$accordions_options = array();
|
43 |
+
|
44 |
+
echo '<pre>'.var_export($post_title, true).'</pre>';
|
45 |
+
|
46 |
+
$accordions_icons_plus = 'plus';
|
47 |
+
$accordions_icons_minus = 'minus';
|
48 |
+
|
49 |
+
|
50 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
51 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
52 |
+
|
53 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
+
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
+
$accordions_options['icon']['background_color'] = '';
|
60 |
+
$accordions_options['icon']['padding'] = '';
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
$accordions_options['header']['class'] = '';
|
66 |
+
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
+
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
+
$accordions_options['header']['color_hover'] = '';
|
71 |
+
$accordions_options['header']['font_size'] = '';
|
72 |
+
$accordions_options['header']['font_family'] = '';
|
73 |
+
$accordions_options['header']['padding'] = '';
|
74 |
+
$accordions_options['header']['margin'] = '';
|
75 |
+
|
76 |
+
|
77 |
+
$accordions_options['body']['class'] = '';
|
78 |
+
|
79 |
+
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
+
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
+
$accordions_options['body']['font_size'] = '';
|
84 |
+
$accordions_options['body']['font_family'] = '';
|
85 |
+
$accordions_options['body']['padding'] = '';
|
86 |
+
$accordions_options['body']['margin'] = '';
|
87 |
+
|
88 |
+
|
89 |
+
$accordions_options['lazy_load'] = '';
|
90 |
+
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
+
$accordions_options['hide_edit'] = '';
|
94 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
98 |
+
$accordions_options['accordion']['enable_search'] = '';
|
99 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
+
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
+
$accordions_options['accordion']['is_child'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
//echo '<pre>'.var_export($post_content, true).'</pre>';
|
112 |
+
|
113 |
+
if( strpos($post_content, '[accordion') !== false){
|
114 |
+
$tabs = accordions_str_between_all($post_content, "[accordion", "[/accordion]");
|
115 |
+
|
116 |
+
if(!empty($tabs))
|
117 |
+
foreach ($tabs as $tab_content){
|
118 |
+
|
119 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='accordion-item');
|
120 |
+
|
121 |
+
$i = 0;
|
122 |
+
|
123 |
+
if(!empty($shortcode_content))
|
124 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
125 |
+
|
126 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
127 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
128 |
+
|
129 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
130 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
131 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
132 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
133 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
134 |
+
|
135 |
+
$active_icon = '';
|
136 |
+
$inactive_icon = '';
|
137 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
138 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
139 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
140 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
141 |
+
|
142 |
+
$i++;
|
143 |
+
}
|
144 |
+
|
145 |
+
$accordions_id = wp_insert_post(
|
146 |
+
array(
|
147 |
+
'post_title' => 'Accordion Shortcodes',
|
148 |
+
'post_content' => '',
|
149 |
+
'post_status' => 'publish',
|
150 |
+
'post_type' => 'accordions',
|
151 |
+
'post_author' => 1,
|
152 |
+
)
|
153 |
+
);
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
update_post_meta($post_id, 'import_done', 'done');
|
164 |
+
|
165 |
+
|
166 |
+
wp_reset_query();
|
167 |
+
wp_reset_postdata();
|
168 |
+
endwhile;
|
169 |
+
else:
|
170 |
+
|
171 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
172 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
173 |
+
|
174 |
+
wp_clear_scheduled_hook('accordions_import_cron_accordion_shortcodes');
|
175 |
+
|
176 |
+
|
177 |
+
endif;
|
178 |
+
|
179 |
+
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
includes/3rd-party/arconix-faq/functions-data-import.php
CHANGED
@@ -2,6 +2,10 @@
|
|
2 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
|
4 |
|
|
|
|
|
|
|
|
|
5 |
add_shortcode('accordions_import_cron_arconix_faq', 'accordions_import_cron_arconix_faq');
|
6 |
add_action('accordions_import_cron_arconix_faq', 'accordions_import_cron_arconix_faq');
|
7 |
|
@@ -11,7 +15,7 @@ function accordions_import_cron_arconix_faq(){
|
|
11 |
|
12 |
$meta_query = array();
|
13 |
|
14 |
-
|
15 |
'key' => 'import_done',
|
16 |
'compare' => 'NOT EXISTS'
|
17 |
);
|
@@ -19,9 +23,8 @@ function accordions_import_cron_arconix_faq(){
|
|
19 |
$args = array(
|
20 |
'post_type'=>'faq',
|
21 |
'post_status'=>'publish',
|
22 |
-
'posts_per_page'=> 1,
|
23 |
'meta_query'=> $meta_query,
|
24 |
-
|
25 |
);
|
26 |
|
27 |
|
@@ -29,132 +32,141 @@ function accordions_import_cron_arconix_faq(){
|
|
29 |
|
30 |
|
31 |
if ( $wp_query->have_posts() ) :
|
32 |
-
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
$post_content = get_the_content();
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
$accordions_icons_plus = 'plus';
|
41 |
-
$accordions_icons_minus = 'minus';
|
42 |
|
43 |
|
44 |
-
|
45 |
-
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
|
70 |
|
71 |
-
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
-
$accordions_options['accordion']['active_event'] = '';
|
96 |
-
$accordions_options['accordion']['enable_search'] = '';
|
97 |
-
$accordions_options['accordion']['search_placeholder_text'] = '';
|
98 |
-
$accordions_options['accordion']['click_scroll_top'] = '';
|
99 |
-
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
100 |
-
$accordions_options['accordion']['header_toggle'] = '';
|
101 |
-
$accordions_options['accordion']['animate_style'] = '';
|
102 |
-
$accordions_options['accordion']['animate_delay'] = '';
|
103 |
-
$accordions_options['accordion']['expand_collapse_display'] = '';
|
104 |
-
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
105 |
-
$accordions_options['accordion']['expand_collapse_text'] = '';
|
106 |
-
$accordions_options['accordion']['is_child'] = '';
|
107 |
|
108 |
|
109 |
-
$i = 0;
|
110 |
|
111 |
-
if(!empty($accordion_content_source))
|
112 |
-
foreach ($accordion_content_source as $index => $accordion_single_data){
|
113 |
|
114 |
-
$accordion_content_title = $accordion_single_data['accordion_content_title'];
|
115 |
-
$accordion_content_description = $accordion_single_data['accordion_content_description'];
|
116 |
|
117 |
-
$accordions_options['content'][$index]['header'] = $post_title;
|
118 |
-
$accordions_options['content'][$index]['body'] = $post_content;
|
119 |
-
$accordions_options['content'][$index]['hide'] = 'no';
|
120 |
-
$accordions_options['content'][$index]['toggled_text'] = '';
|
121 |
-
$accordions_options['content'][$index]['is_active'] = '';
|
122 |
-
$accordions_options['content'][$index]['active_icon'] = '';
|
123 |
-
$accordions_options['content'][$index]['inactive_icon'] = '';
|
124 |
-
$accordions_options['content'][$index]['background_color'] = '';
|
125 |
-
$accordions_options['content'][$index]['background_img'] = '';
|
126 |
|
127 |
-
$i++;
|
128 |
-
}
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
-
$post_data = array(
|
132 |
-
'post_title' => $post_title,
|
133 |
-
'post_content' => '',
|
134 |
-
'post_status' => 'publish',
|
135 |
-
'post_type' => 'accordions',
|
136 |
-
'post_author' => 1,
|
137 |
-
);
|
138 |
|
139 |
-
$
|
|
|
|
|
|
|
140 |
|
141 |
|
142 |
-
|
143 |
-
update_post_meta($post_id, 'import_done', 'done');
|
144 |
|
145 |
|
146 |
-
|
147 |
-
|
148 |
-
echo 'import done: '.$post_title;
|
149 |
-
echo '<br/>';
|
150 |
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
|
|
153 |
endwhile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
else:
|
155 |
|
156 |
$accordions_plugin_info['3rd_party_import'] = 'done';
|
157 |
-
|
158 |
update_option('accordions_plugin_info', $accordions_plugin_info);
|
159 |
|
160 |
wp_clear_scheduled_hook('accordions_import_cron_arconix_faq');
|
2 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
|
4 |
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
add_shortcode('accordions_import_cron_arconix_faq', 'accordions_import_cron_arconix_faq');
|
10 |
add_action('accordions_import_cron_arconix_faq', 'accordions_import_cron_arconix_faq');
|
11 |
|
15 |
|
16 |
$meta_query = array();
|
17 |
|
18 |
+
$meta_query[] = array(
|
19 |
'key' => 'import_done',
|
20 |
'compare' => 'NOT EXISTS'
|
21 |
);
|
23 |
$args = array(
|
24 |
'post_type'=>'faq',
|
25 |
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> -1,
|
27 |
'meta_query'=> $meta_query,
|
|
|
28 |
);
|
29 |
|
30 |
|
32 |
|
33 |
|
34 |
if ( $wp_query->have_posts() ) :
|
|
|
35 |
|
36 |
+
$accordions_options = array();
|
37 |
+
|
|
|
38 |
|
39 |
+
$accordions_icons_plus = 'plus';
|
40 |
+
$accordions_icons_minus = 'minus';
|
|
|
|
|
41 |
|
42 |
|
43 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
44 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
45 |
|
46 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
47 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
48 |
+
$accordions_options['icon']['position'] = '';
|
49 |
+
$accordions_options['icon']['color'] = '';
|
50 |
+
$accordions_options['icon']['color_hover'] = '';
|
51 |
+
$accordions_options['icon']['font_size'] = '';
|
52 |
+
$accordions_options['icon']['background_color'] = '';
|
53 |
+
$accordions_options['icon']['padding'] = '';
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
+
$accordions_options['header']['class'] = '';
|
59 |
+
$accordions_options['header']['active_background_color'] = '';
|
60 |
+
$accordions_options['header']['background_color'] = '';
|
61 |
+
$accordions_options['header']['background_opacity'] = '';
|
62 |
+
$accordions_options['header']['color'] = '';
|
63 |
+
$accordions_options['header']['color_hover'] = '';
|
64 |
+
$accordions_options['header']['font_size'] = '';
|
65 |
+
$accordions_options['header']['font_family'] = '';
|
66 |
+
$accordions_options['header']['padding'] = '';
|
67 |
+
$accordions_options['header']['margin'] = '';
|
68 |
|
69 |
|
70 |
+
$accordions_options['body']['class'] = '';
|
71 |
|
72 |
+
$accordions_options['body']['active_background_color'] = '';
|
73 |
+
$accordions_options['body']['background_color'] = '';
|
74 |
+
$accordions_options['body']['background_opacity'] = '';
|
75 |
+
$accordions_options['body']['color'] = '';
|
76 |
+
$accordions_options['body']['font_size'] = '';
|
77 |
+
$accordions_options['body']['font_family'] = '';
|
78 |
+
$accordions_options['body']['padding'] = '';
|
79 |
+
$accordions_options['body']['margin'] = '';
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
+
$accordions_options['lazy_load'] = !empty($eap_preloader) ? 'yes' : 'no';
|
86 |
+
$accordions_options['lazy_load_src'] = '';
|
87 |
+
$accordions_options['hide_edit'] = '';
|
88 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
89 |
+
$accordions_options['accordion']['expanded_other'] = !empty($eap_mutliple_collapse) ? 'yes' : 'no';
|
90 |
+
$accordions_options['accordion']['height_style'] = !empty($eap_accordion_fillspace) ? 'content' : '';
|
91 |
|
92 |
|
93 |
+
$accordions_options['accordion']['active_event'] = '';
|
94 |
+
$accordions_options['accordion']['enable_search'] = '';
|
95 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
96 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
97 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
98 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
99 |
+
$accordions_options['accordion']['animate_style'] = '';
|
100 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
101 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
102 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
103 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
104 |
+
$accordions_options['accordion']['is_child'] = '';
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
|
|
|
108 |
|
|
|
|
|
109 |
|
|
|
|
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
|
|
|
|
112 |
|
113 |
+
$index = 0;
|
114 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
115 |
+
|
116 |
+
$post_id = get_the_id();
|
117 |
+
$post_title = get_the_title();
|
118 |
+
$post_content = get_the_content();
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
+
$accordions_options['content'][$index]['header'] = $post_title;
|
122 |
+
$accordions_options['content'][$index]['body'] = $post_content;
|
123 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
124 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
125 |
|
126 |
|
127 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
|
|
128 |
|
129 |
|
130 |
+
$accordions_options['content'][$index]['active_icon'] = '';
|
131 |
+
$accordions_options['content'][$index]['inactive_icon'] = '';
|
|
|
|
|
132 |
|
133 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
134 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
135 |
+
|
136 |
+
update_post_meta($post_id, 'import_done', 'done');
|
137 |
+
|
138 |
+
$index++;
|
139 |
endwhile;
|
140 |
+
|
141 |
+
echo '<pre>'.var_export($accordions_options, true).'</pre>';
|
142 |
+
|
143 |
+
|
144 |
+
$post_data = array(
|
145 |
+
'post_title' => 'FAQ',
|
146 |
+
'post_content' => '',
|
147 |
+
'post_status' => 'publish',
|
148 |
+
'post_type' => 'accordions',
|
149 |
+
'post_author' => 1,
|
150 |
+
);
|
151 |
+
|
152 |
+
$accordions_id = wp_insert_post($post_data);
|
153 |
+
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
echo '##################';
|
159 |
+
echo '<br/>';
|
160 |
+
echo 'import done: '.$post_title;
|
161 |
+
echo '<br/>';
|
162 |
+
|
163 |
+
|
164 |
+
wp_reset_query();
|
165 |
+
wp_reset_postdata();
|
166 |
+
|
167 |
else:
|
168 |
|
169 |
$accordions_plugin_info['3rd_party_import'] = 'done';
|
|
|
170 |
update_option('accordions_plugin_info', $accordions_plugin_info);
|
171 |
|
172 |
wp_clear_scheduled_hook('accordions_import_cron_arconix_faq');
|
includes/3rd-party/easy-responsive-tabs/functions-data-import.php
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_easy_responsive_tabs', 'accordions_import_cron_easy_responsive_tabs');
|
10 |
+
add_action('accordions_import_cron_easy_responsive_tabs', 'accordions_import_cron_easy_responsive_tabs');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_easy_responsive_tabs(){
|
14 |
+
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=> array( 'page','post' ),
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 20,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
41 |
+
|
42 |
+
$accordions_options = array();
|
43 |
+
|
44 |
+
//echo '<pre>'.var_export($acc_sec_title, true).'</pre>';
|
45 |
+
|
46 |
+
$accordions_icons_plus = 'plus';
|
47 |
+
$accordions_icons_minus = 'minus';
|
48 |
+
|
49 |
+
|
50 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
51 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
52 |
+
|
53 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
+
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
+
$accordions_options['icon']['background_color'] = '';
|
60 |
+
$accordions_options['icon']['padding'] = '';
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
$accordions_options['header']['class'] = '';
|
66 |
+
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
+
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
+
$accordions_options['header']['color_hover'] = '';
|
71 |
+
$accordions_options['header']['font_size'] = '';
|
72 |
+
$accordions_options['header']['font_family'] = '';
|
73 |
+
$accordions_options['header']['padding'] = '';
|
74 |
+
$accordions_options['header']['margin'] = '';
|
75 |
+
|
76 |
+
|
77 |
+
$accordions_options['body']['class'] = '';
|
78 |
+
|
79 |
+
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
+
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
+
$accordions_options['body']['font_size'] = '';
|
84 |
+
$accordions_options['body']['font_family'] = '';
|
85 |
+
$accordions_options['body']['padding'] = '';
|
86 |
+
$accordions_options['body']['margin'] = '';
|
87 |
+
|
88 |
+
|
89 |
+
$accordions_options['lazy_load'] = '';
|
90 |
+
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
+
$accordions_options['hide_edit'] = '';
|
94 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
98 |
+
$accordions_options['accordion']['enable_search'] = '';
|
99 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
+
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
+
$accordions_options['accordion']['is_child'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
if(strpos($post_content, '[restabs') !== false){
|
114 |
+
$tabs = accordions_str_between_all($post_content, "[restabs", "[/restabs]");
|
115 |
+
|
116 |
+
foreach ($tabs as $tab_content){
|
117 |
+
|
118 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='restab');
|
119 |
+
echo '<pre>'.var_export('#####', true).'</pre>';
|
120 |
+
echo '<pre>'.var_export($shortcode_content, true).'</pre>';
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
$i = 0;
|
126 |
+
|
127 |
+
if(!empty($shortcode_content))
|
128 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
129 |
+
|
130 |
+
|
131 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
132 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
133 |
+
|
134 |
+
|
135 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
136 |
+
|
137 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
138 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
139 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
140 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
141 |
+
|
142 |
+
|
143 |
+
$active_icon = '';
|
144 |
+
$inactive_icon = '';
|
145 |
+
|
146 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
147 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
148 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
149 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
150 |
+
|
151 |
+
$i++;
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
|
156 |
+
|
157 |
+
|
158 |
+
$accordions_id = wp_insert_post(
|
159 |
+
array(
|
160 |
+
'post_title' => $post_title,
|
161 |
+
'post_content' => '',
|
162 |
+
'post_status' => 'publish',
|
163 |
+
'post_type' => 'accordions',
|
164 |
+
'post_author' => 1,
|
165 |
+
)
|
166 |
+
);
|
167 |
+
|
168 |
+
|
169 |
+
|
170 |
+
|
171 |
+
|
172 |
+
|
173 |
+
|
174 |
+
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
|
179 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
180 |
+
update_post_meta($post_id, 'import_done', 'done');
|
181 |
+
|
182 |
+
|
183 |
+
echo '##################';
|
184 |
+
echo '<br/>';
|
185 |
+
echo 'import done: '.$post_title;
|
186 |
+
echo '<br/>';
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
}
|
193 |
+
}else{
|
194 |
+
update_post_meta($post_id, 'import_done', 'done');
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
|
199 |
+
|
200 |
+
|
201 |
+
wp_reset_query();
|
202 |
+
wp_reset_postdata();
|
203 |
+
endwhile;
|
204 |
+
else:
|
205 |
+
|
206 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
207 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
208 |
+
|
209 |
+
wp_clear_scheduled_hook('accordions_import_cron_easy_responsive_tabs');
|
210 |
+
|
211 |
+
|
212 |
+
endif;
|
213 |
+
|
214 |
+
|
215 |
+
}
|
216 |
+
|
217 |
+
|
218 |
+
|
219 |
+
|
includes/3rd-party/everest-tab-lite/functions-data-import.php
ADDED
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_everest_tab_lite', 'accordions_import_cron_everest_tab_lite');
|
10 |
+
add_action('accordions_import_cron_everest_tab_lite', 'accordions_import_cron_everest_tab_lite');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_everest_tab_lite(){
|
14 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
+
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=>'everest_tab',
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 1,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
|
29 |
+
);
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$accordions_options = array();
|
41 |
+
|
42 |
+
//echo $accordions_title.'<br/>';
|
43 |
+
$et_main_settings = get_post_meta( $post_id, 'et_main_settings', true );
|
44 |
+
$et_tab_settings = get_post_meta( $post_id, 'et_tab_settings', true );
|
45 |
+
|
46 |
+
|
47 |
+
echo '<pre>'.var_export($et_tab_settings, ture).'</pre>';
|
48 |
+
|
49 |
+
$tab_items = $et_main_settings['tab_items'];
|
50 |
+
|
51 |
+
|
52 |
+
$custom_settings = $et_main_settings['custom_settings'];
|
53 |
+
$general_settings = $et_main_settings['general_settings'];
|
54 |
+
|
55 |
+
$bg_color = $custom_settings['bg_color'];
|
56 |
+
$bg_hover_color = $custom_settings['bg_hover_color'];
|
57 |
+
$bg_active_color = $custom_settings['bg_active_color'];
|
58 |
+
$font_color = $custom_settings['font_color'];
|
59 |
+
$font_hover_color = $custom_settings['font_hover_color'];
|
60 |
+
$subtitle_fcolor = $custom_settings['subtitle_fcolor'];
|
61 |
+
$subtitle_fhcolor = $custom_settings['subtitle_fhcolor'];
|
62 |
+
$desc_color = $custom_settings['desc_color'];
|
63 |
+
$bg_tab_content_color = $custom_settings['bg_tab_content_color'];
|
64 |
+
|
65 |
+
$tab_position = $custom_settings['tab_position'];
|
66 |
+
|
67 |
+
|
68 |
+
$accordions_icons_plus = 'plus';
|
69 |
+
$accordions_icons_minus = 'minus';
|
70 |
+
|
71 |
+
|
72 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
73 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
74 |
+
|
75 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
76 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
77 |
+
$accordions_options['icon']['position'] = '';
|
78 |
+
$accordions_options['icon']['color'] = $font_color;
|
79 |
+
$accordions_options['icon']['color_hover'] = $font_hover_color;
|
80 |
+
$accordions_options['icon']['font_size'] = '';
|
81 |
+
$accordions_options['icon']['background_color'] = $bg_color;
|
82 |
+
$accordions_options['icon']['padding'] = '';
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
$accordions_options['header']['class'] = '';
|
88 |
+
$accordions_options['header']['active_background_color'] = $bg_active_color;
|
89 |
+
$accordions_options['header']['background_color'] = $bg_color;
|
90 |
+
$accordions_options['header']['background_opacity'] = '';
|
91 |
+
$accordions_options['header']['color'] = $font_color;
|
92 |
+
$accordions_options['header']['color_hover'] = $font_hover_color;
|
93 |
+
$accordions_options['header']['font_size'] = '';
|
94 |
+
$accordions_options['header']['font_family'] = '';
|
95 |
+
$accordions_options['header']['padding'] = '';
|
96 |
+
$accordions_options['header']['margin'] = '';
|
97 |
+
|
98 |
+
|
99 |
+
$accordions_options['body']['class'] = '';
|
100 |
+
|
101 |
+
$accordions_options['body']['active_background_color'] = '';
|
102 |
+
$accordions_options['body']['background_color'] = $bg_tab_content_color;
|
103 |
+
$accordions_options['body']['background_opacity'] = '';
|
104 |
+
$accordions_options['body']['color'] = $desc_color;
|
105 |
+
$accordions_options['body']['font_size'] = '';
|
106 |
+
$accordions_options['body']['font_family'] = '';
|
107 |
+
$accordions_options['body']['padding'] = '';
|
108 |
+
$accordions_options['body']['margin'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
|
114 |
+
$accordions_options['lazy_load'] = !empty($eap_preloader) ? 'yes' : 'no';
|
115 |
+
$accordions_options['lazy_load_src'] = '';
|
116 |
+
$accordions_options['view_type'] = 'tabs';
|
117 |
+
|
118 |
+
$accordions_options['hide_edit'] = '';
|
119 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
120 |
+
$accordions_options['accordion']['expanded_other'] = !empty($eap_mutliple_collapse) ? 'yes' : 'no';
|
121 |
+
$accordions_options['accordion']['height_style'] = !empty($eap_accordion_fillspace) ? 'content' : '';
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
126 |
+
$accordions_options['accordion']['enable_search'] = '';
|
127 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
128 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
129 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
130 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
131 |
+
$accordions_options['accordion']['animate_style'] = '';
|
132 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
133 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
134 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
135 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
136 |
+
$accordions_options['accordion']['is_child'] = '';
|
137 |
+
|
138 |
+
$accordions_options['tabs']['navs_alignment'] = '';
|
139 |
+
$accordions_options['tabs']['active_event'] = '';
|
140 |
+
$accordions_options['tabs']['collapsible'] = '';
|
141 |
+
|
142 |
+
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
|
147 |
+
|
148 |
+
|
149 |
+
|
150 |
+
$i = 0;
|
151 |
+
|
152 |
+
if(!empty($et_tab_settings))
|
153 |
+
foreach ($et_tab_settings as $index => $accordion_single_data){
|
154 |
+
|
155 |
+
$tab_label = $accordion_single_data['tab_label'];
|
156 |
+
$html_text = $accordion_single_data['html_text'];
|
157 |
+
|
158 |
+
|
159 |
+
|
160 |
+
|
161 |
+
|
162 |
+
$accordions_options['content'][$index]['header'] = $tab_label;
|
163 |
+
|
164 |
+
$accordions_options['content'][$index]['body'] = $html_text;
|
165 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
166 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
167 |
+
|
168 |
+
|
169 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
170 |
+
|
171 |
+
|
172 |
+
$accordions_options['content'][$index]['active_icon'] = '';
|
173 |
+
$accordions_options['content'][$index]['inactive_icon'] = '';
|
174 |
+
|
175 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
176 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
177 |
+
|
178 |
+
$i++;
|
179 |
+
}
|
180 |
+
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
$post_data = array(
|
185 |
+
'post_title' => $post_title,
|
186 |
+
'post_content' => '',
|
187 |
+
'post_status' => 'publish',
|
188 |
+
'post_type' => 'accordions',
|
189 |
+
'post_author' => 1,
|
190 |
+
);
|
191 |
+
|
192 |
+
$accordions_id = wp_insert_post($post_data);
|
193 |
+
|
194 |
+
|
195 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
196 |
+
update_post_meta($post_id, 'import_done', 'done');
|
197 |
+
|
198 |
+
|
199 |
+
echo '##################';
|
200 |
+
echo '<br/>';
|
201 |
+
echo 'import done: '.$post_title;
|
202 |
+
echo '<br/>';
|
203 |
+
|
204 |
+
wp_reset_query();
|
205 |
+
wp_reset_postdata();
|
206 |
+
endwhile;
|
207 |
+
else:
|
208 |
+
|
209 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
210 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
211 |
+
|
212 |
+
wp_clear_scheduled_hook('accordions_import_cron_everest_tab_lite');
|
213 |
+
|
214 |
+
|
215 |
+
endif;
|
216 |
+
|
217 |
+
|
218 |
+
}
|
219 |
+
|
220 |
+
|
221 |
+
|
222 |
+
|
includes/3rd-party/helpie-faq/functions-data-import.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_helpie_faq', 'accordions_import_cron_helpie_faq');
|
10 |
+
add_action('accordions_import_cron_helpie_faq', 'accordions_import_cron_helpie_faq');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_helpie_faq(){
|
14 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
+
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=>'helpie_faq',
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> -1,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
$wp_query = new WP_Query($args);
|
32 |
+
|
33 |
+
|
34 |
+
if ( $wp_query->have_posts() ) :
|
35 |
+
|
36 |
+
$accordions_options = array();
|
37 |
+
|
38 |
+
|
39 |
+
$accordions_icons_plus = 'plus';
|
40 |
+
$accordions_icons_minus = 'minus';
|
41 |
+
|
42 |
+
|
43 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
44 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
45 |
+
|
46 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
47 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
48 |
+
$accordions_options['icon']['position'] = '';
|
49 |
+
$accordions_options['icon']['color'] = '';
|
50 |
+
$accordions_options['icon']['color_hover'] = '';
|
51 |
+
$accordions_options['icon']['font_size'] = '';
|
52 |
+
$accordions_options['icon']['background_color'] = '';
|
53 |
+
$accordions_options['icon']['padding'] = '';
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
$accordions_options['header']['class'] = '';
|
59 |
+
$accordions_options['header']['active_background_color'] = '';
|
60 |
+
$accordions_options['header']['background_color'] = '';
|
61 |
+
$accordions_options['header']['background_opacity'] = '';
|
62 |
+
$accordions_options['header']['color'] = '';
|
63 |
+
$accordions_options['header']['color_hover'] = '';
|
64 |
+
$accordions_options['header']['font_size'] = '';
|
65 |
+
$accordions_options['header']['font_family'] = '';
|
66 |
+
$accordions_options['header']['padding'] = '';
|
67 |
+
$accordions_options['header']['margin'] = '';
|
68 |
+
|
69 |
+
|
70 |
+
$accordions_options['body']['class'] = '';
|
71 |
+
|
72 |
+
$accordions_options['body']['active_background_color'] = '';
|
73 |
+
$accordions_options['body']['background_color'] = '';
|
74 |
+
$accordions_options['body']['background_opacity'] = '';
|
75 |
+
$accordions_options['body']['color'] = '';
|
76 |
+
$accordions_options['body']['font_size'] = '';
|
77 |
+
$accordions_options['body']['font_family'] = '';
|
78 |
+
$accordions_options['body']['padding'] = '';
|
79 |
+
$accordions_options['body']['margin'] = '';
|
80 |
+
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
$accordions_options['lazy_load'] = !empty($eap_preloader) ? 'yes' : 'no';
|
86 |
+
$accordions_options['lazy_load_src'] = '';
|
87 |
+
$accordions_options['hide_edit'] = '';
|
88 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
89 |
+
$accordions_options['accordion']['expanded_other'] = !empty($eap_mutliple_collapse) ? 'yes' : 'no';
|
90 |
+
$accordions_options['accordion']['height_style'] = !empty($eap_accordion_fillspace) ? 'content' : '';
|
91 |
+
|
92 |
+
|
93 |
+
$accordions_options['accordion']['active_event'] = '';
|
94 |
+
$accordions_options['accordion']['enable_search'] = '';
|
95 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
96 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
97 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
98 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
99 |
+
$accordions_options['accordion']['animate_style'] = '';
|
100 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
101 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
102 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
103 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
104 |
+
$accordions_options['accordion']['is_child'] = '';
|
105 |
+
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
$index = 0;
|
114 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
115 |
+
|
116 |
+
$post_id = get_the_id();
|
117 |
+
$post_title = get_the_title();
|
118 |
+
$post_content = get_the_content();
|
119 |
+
|
120 |
+
|
121 |
+
$accordions_options['content'][$index]['header'] = $post_title;
|
122 |
+
$accordions_options['content'][$index]['body'] = $post_content;
|
123 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
124 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
125 |
+
|
126 |
+
|
127 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
128 |
+
|
129 |
+
|
130 |
+
$accordions_options['content'][$index]['active_icon'] = '';
|
131 |
+
$accordions_options['content'][$index]['inactive_icon'] = '';
|
132 |
+
|
133 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
134 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
135 |
+
|
136 |
+
update_post_meta($post_id, 'import_done', 'done');
|
137 |
+
|
138 |
+
$index++;
|
139 |
+
endwhile;
|
140 |
+
|
141 |
+
echo '<pre>'.var_export($accordions_options, true).'</pre>';
|
142 |
+
|
143 |
+
|
144 |
+
$post_data = array(
|
145 |
+
'post_title' => 'helpie FAQ',
|
146 |
+
'post_content' => '',
|
147 |
+
'post_status' => 'publish',
|
148 |
+
'post_type' => 'accordions',
|
149 |
+
'post_author' => 1,
|
150 |
+
);
|
151 |
+
|
152 |
+
$accordions_id = wp_insert_post($post_data);
|
153 |
+
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
echo '##################';
|
159 |
+
echo '<br/>';
|
160 |
+
echo 'import done: '.$post_title;
|
161 |
+
echo '<br/>';
|
162 |
+
|
163 |
+
|
164 |
+
wp_reset_query();
|
165 |
+
wp_reset_postdata();
|
166 |
+
|
167 |
+
else:
|
168 |
+
|
169 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
170 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
171 |
+
|
172 |
+
wp_clear_scheduled_hook('accordions_import_cron_helpie_faq');
|
173 |
+
|
174 |
+
|
175 |
+
endif;
|
176 |
+
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
|
includes/3rd-party/meks-flexible-shortcodes/functions-data-import.php
ADDED
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_meks_flexible_shortcodes', 'accordions_import_cron_meks_flexible_shortcodes');
|
10 |
+
add_action('accordions_import_cron_meks_flexible_shortcodes', 'accordions_import_cron_meks_flexible_shortcodes');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_meks_flexible_shortcodes(){
|
14 |
+
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=> array( 'page', 'post' ),
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 10,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
41 |
+
|
42 |
+
$accordions_options = array();
|
43 |
+
|
44 |
+
echo '<pre>'.var_export($post_title, true).'</pre>';
|
45 |
+
|
46 |
+
$accordions_icons_plus = 'plus';
|
47 |
+
$accordions_icons_minus = 'minus';
|
48 |
+
|
49 |
+
|
50 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
51 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
52 |
+
|
53 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
+
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
+
$accordions_options['icon']['background_color'] = '';
|
60 |
+
$accordions_options['icon']['padding'] = '';
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
$accordions_options['header']['class'] = '';
|
66 |
+
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
+
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
+
$accordions_options['header']['color_hover'] = '';
|
71 |
+
$accordions_options['header']['font_size'] = '';
|
72 |
+
$accordions_options['header']['font_family'] = '';
|
73 |
+
$accordions_options['header']['padding'] = '';
|
74 |
+
$accordions_options['header']['margin'] = '';
|
75 |
+
|
76 |
+
|
77 |
+
$accordions_options['body']['class'] = '';
|
78 |
+
|
79 |
+
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
+
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
+
$accordions_options['body']['font_size'] = '';
|
84 |
+
$accordions_options['body']['font_family'] = '';
|
85 |
+
$accordions_options['body']['padding'] = '';
|
86 |
+
$accordions_options['body']['margin'] = '';
|
87 |
+
|
88 |
+
|
89 |
+
$accordions_options['lazy_load'] = '';
|
90 |
+
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
+
$accordions_options['hide_edit'] = '';
|
94 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
98 |
+
$accordions_options['accordion']['enable_search'] = '';
|
99 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
+
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
+
$accordions_options['accordion']['is_child'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
//echo '<pre>'.var_export($post_content, true).'</pre>';
|
112 |
+
|
113 |
+
if( strpos($post_content, '[mks_accordion') !== false){
|
114 |
+
$tabs = accordions_str_between_all($post_content, "[mks_accordion", "[/mks_accordion]");
|
115 |
+
|
116 |
+
if(!empty($tabs))
|
117 |
+
foreach ($tabs as $tab_content){
|
118 |
+
|
119 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='mks_accordion_item');
|
120 |
+
|
121 |
+
$i = 0;
|
122 |
+
|
123 |
+
if(!empty($shortcode_content))
|
124 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
125 |
+
|
126 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
127 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
128 |
+
|
129 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
130 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
131 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
132 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
133 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
134 |
+
|
135 |
+
$active_icon = '';
|
136 |
+
$inactive_icon = '';
|
137 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
138 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
139 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
140 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
141 |
+
|
142 |
+
$i++;
|
143 |
+
}
|
144 |
+
|
145 |
+
$accordions_id = wp_insert_post(
|
146 |
+
array(
|
147 |
+
'post_title' => 'mks accordion',
|
148 |
+
'post_content' => '',
|
149 |
+
'post_status' => 'publish',
|
150 |
+
'post_type' => 'accordions',
|
151 |
+
'post_author' => 1,
|
152 |
+
)
|
153 |
+
);
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
if( strpos($post_content, '[mks_tabs') !== false){
|
164 |
+
$tabs = accordions_str_between_all($post_content, "[mks_tabs", "[/mks_tabs]");
|
165 |
+
|
166 |
+
if(!empty($tabs))
|
167 |
+
foreach ($tabs as $tab_content){
|
168 |
+
|
169 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='mks_tab_item');
|
170 |
+
|
171 |
+
$i = 0;
|
172 |
+
|
173 |
+
if(!empty($shortcode_content))
|
174 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
175 |
+
|
176 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
177 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
178 |
+
|
179 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
180 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
181 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
182 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
183 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
184 |
+
|
185 |
+
$active_icon = '';
|
186 |
+
$inactive_icon = '';
|
187 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
188 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
189 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
190 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
191 |
+
|
192 |
+
$i++;
|
193 |
+
}
|
194 |
+
|
195 |
+
$accordions_id = wp_insert_post(
|
196 |
+
array(
|
197 |
+
'post_title' => 'mks tabs',
|
198 |
+
'post_content' => '',
|
199 |
+
'post_status' => 'publish',
|
200 |
+
'post_type' => 'accordions',
|
201 |
+
'post_author' => 1,
|
202 |
+
)
|
203 |
+
);
|
204 |
+
|
205 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
206 |
+
|
207 |
+
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
|
215 |
+
update_post_meta($post_id, 'import_done', 'done');
|
216 |
+
|
217 |
+
|
218 |
+
wp_reset_query();
|
219 |
+
wp_reset_postdata();
|
220 |
+
endwhile;
|
221 |
+
else:
|
222 |
+
|
223 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
224 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
225 |
+
|
226 |
+
wp_clear_scheduled_hook('accordions_import_cron_meks_flexible_shortcodes');
|
227 |
+
|
228 |
+
|
229 |
+
endif;
|
230 |
+
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
|
includes/3rd-party/quick-and-easy-faqs/functions-data-import.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_quick_easy_faqs', 'accordions_import_cron_quick_easy_faqs');
|
10 |
+
add_action('accordions_import_cron_quick_easy_faqs', 'accordions_import_cron_quick_easy_faqs');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_quick_easy_faqs(){
|
14 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
+
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=>'faq',
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> -1,
|
27 |
+
//'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
$wp_query = new WP_Query($args);
|
32 |
+
|
33 |
+
|
34 |
+
if ( $wp_query->have_posts() ) :
|
35 |
+
|
36 |
+
$accordions_options = array();
|
37 |
+
|
38 |
+
|
39 |
+
$accordions_icons_plus = 'plus';
|
40 |
+
$accordions_icons_minus = 'minus';
|
41 |
+
|
42 |
+
|
43 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
44 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
45 |
+
|
46 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
47 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
48 |
+
$accordions_options['icon']['position'] = '';
|
49 |
+
$accordions_options['icon']['color'] = '';
|
50 |
+
$accordions_options['icon']['color_hover'] = '';
|
51 |
+
$accordions_options['icon']['font_size'] = '';
|
52 |
+
$accordions_options['icon']['background_color'] = '';
|
53 |
+
$accordions_options['icon']['padding'] = '';
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
$accordions_options['header']['class'] = '';
|
59 |
+
$accordions_options['header']['active_background_color'] = '';
|
60 |
+
$accordions_options['header']['background_color'] = '';
|
61 |
+
$accordions_options['header']['background_opacity'] = '';
|
62 |
+
$accordions_options['header']['color'] = '';
|
63 |
+
$accordions_options['header']['color_hover'] = '';
|
64 |
+
$accordions_options['header']['font_size'] = '';
|
65 |
+
$accordions_options['header']['font_family'] = '';
|
66 |
+
$accordions_options['header']['padding'] = '';
|
67 |
+
$accordions_options['header']['margin'] = '';
|
68 |
+
|
69 |
+
|
70 |
+
$accordions_options['body']['class'] = '';
|
71 |
+
|
72 |
+
$accordions_options['body']['active_background_color'] = '';
|
73 |
+
$accordions_options['body']['background_color'] = '';
|
74 |
+
$accordions_options['body']['background_opacity'] = '';
|
75 |
+
$accordions_options['body']['color'] = '';
|
76 |
+
$accordions_options['body']['font_size'] = '';
|
77 |
+
$accordions_options['body']['font_family'] = '';
|
78 |
+
$accordions_options['body']['padding'] = '';
|
79 |
+
$accordions_options['body']['margin'] = '';
|
80 |
+
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
$accordions_options['lazy_load'] = !empty($eap_preloader) ? 'yes' : 'no';
|
86 |
+
$accordions_options['lazy_load_src'] = '';
|
87 |
+
$accordions_options['hide_edit'] = '';
|
88 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
89 |
+
$accordions_options['accordion']['expanded_other'] = !empty($eap_mutliple_collapse) ? 'yes' : 'no';
|
90 |
+
$accordions_options['accordion']['height_style'] = !empty($eap_accordion_fillspace) ? 'content' : '';
|
91 |
+
|
92 |
+
|
93 |
+
$accordions_options['accordion']['active_event'] = '';
|
94 |
+
$accordions_options['accordion']['enable_search'] = '';
|
95 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
96 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
97 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
98 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
99 |
+
$accordions_options['accordion']['animate_style'] = '';
|
100 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
101 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
102 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
103 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
104 |
+
$accordions_options['accordion']['is_child'] = '';
|
105 |
+
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
$index = 0;
|
114 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
115 |
+
|
116 |
+
$post_id = get_the_id();
|
117 |
+
$post_title = get_the_title();
|
118 |
+
$post_content = get_the_content();
|
119 |
+
|
120 |
+
|
121 |
+
$accordions_options['content'][$index]['header'] = $post_title;
|
122 |
+
$accordions_options['content'][$index]['body'] = $post_content;
|
123 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
124 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
125 |
+
|
126 |
+
|
127 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
128 |
+
|
129 |
+
|
130 |
+
$accordions_options['content'][$index]['active_icon'] = '';
|
131 |
+
$accordions_options['content'][$index]['inactive_icon'] = '';
|
132 |
+
|
133 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
134 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
135 |
+
|
136 |
+
//update_post_meta($post_id, 'import_done', 'done');
|
137 |
+
|
138 |
+
$index++;
|
139 |
+
endwhile;
|
140 |
+
|
141 |
+
echo '<pre>'.var_export($accordions_options, true).'</pre>';
|
142 |
+
|
143 |
+
|
144 |
+
$post_data = array(
|
145 |
+
'post_title' => 'Quick and Easy FAQs',
|
146 |
+
'post_content' => '',
|
147 |
+
'post_status' => 'publish',
|
148 |
+
'post_type' => 'accordions',
|
149 |
+
'post_author' => 1,
|
150 |
+
);
|
151 |
+
|
152 |
+
$accordions_id = wp_insert_post($post_data);
|
153 |
+
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
echo '##################';
|
159 |
+
echo '<br/>';
|
160 |
+
echo 'import done: '.$post_title;
|
161 |
+
echo '<br/>';
|
162 |
+
|
163 |
+
|
164 |
+
wp_reset_query();
|
165 |
+
wp_reset_postdata();
|
166 |
+
|
167 |
+
else:
|
168 |
+
|
169 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
170 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
171 |
+
|
172 |
+
wp_clear_scheduled_hook('accordions_import_cron_quick_easy_faqs');
|
173 |
+
|
174 |
+
|
175 |
+
endif;
|
176 |
+
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
|
includes/3rd-party/responsive-accordion-and-collapse/functions-data-import.php
CHANGED
@@ -6,11 +6,11 @@ if ( ! defined('ABSPATH')) exit; // if direct access
|
|
6 |
|
7 |
|
8 |
|
9 |
-
add_shortcode('
|
10 |
-
add_action('
|
11 |
|
12 |
|
13 |
-
function
|
14 |
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
|
16 |
$meta_query = array();
|
@@ -223,7 +223,7 @@ function accordions_import_cron_wpsm_ac(){
|
|
223 |
$accordions_plugin_info['3rd_party_import'] = 'done';
|
224 |
update_option('accordions_plugin_info', $accordions_plugin_info);
|
225 |
|
226 |
-
wp_clear_scheduled_hook('
|
227 |
|
228 |
|
229 |
endif;
|
6 |
|
7 |
|
8 |
|
9 |
+
add_shortcode('accordions_import_cron_responsive_accordion_collapse', 'accordions_import_cron_responsive_accordion_collapse');
|
10 |
+
add_action('accordions_import_cron_responsive_accordion_collapse', 'accordions_import_cron_responsive_accordion_collapse');
|
11 |
|
12 |
|
13 |
+
function accordions_import_cron_responsive_accordion_collapse(){
|
14 |
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
|
16 |
$meta_query = array();
|
223 |
$accordions_plugin_info['3rd_party_import'] = 'done';
|
224 |
update_option('accordions_plugin_info', $accordions_plugin_info);
|
225 |
|
226 |
+
wp_clear_scheduled_hook('accordions_import_cron_responsive_accordion_collapse');
|
227 |
|
228 |
|
229 |
endif;
|
includes/3rd-party/shortcodes-ultimate/functions-data-import.php
ADDED
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_shortcodes_ultimate', 'accordions_import_cron_shortcodes_ultimate');
|
10 |
+
add_action('accordions_import_cron_shortcodes_ultimate', 'accordions_import_cron_shortcodes_ultimate');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_shortcodes_ultimate(){
|
14 |
+
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=> array( 'page', 'post' ),
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 10,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
41 |
+
|
42 |
+
$accordions_options = array();
|
43 |
+
|
44 |
+
echo '<pre>'.var_export($post_title, true).'</pre>';
|
45 |
+
|
46 |
+
$accordions_icons_plus = 'plus';
|
47 |
+
$accordions_icons_minus = 'minus';
|
48 |
+
|
49 |
+
|
50 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
51 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
52 |
+
|
53 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
+
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
+
$accordions_options['icon']['background_color'] = '';
|
60 |
+
$accordions_options['icon']['padding'] = '';
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
$accordions_options['header']['class'] = '';
|
66 |
+
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
+
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
+
$accordions_options['header']['color_hover'] = '';
|
71 |
+
$accordions_options['header']['font_size'] = '';
|
72 |
+
$accordions_options['header']['font_family'] = '';
|
73 |
+
$accordions_options['header']['padding'] = '';
|
74 |
+
$accordions_options['header']['margin'] = '';
|
75 |
+
|
76 |
+
|
77 |
+
$accordions_options['body']['class'] = '';
|
78 |
+
|
79 |
+
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
+
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
+
$accordions_options['body']['font_size'] = '';
|
84 |
+
$accordions_options['body']['font_family'] = '';
|
85 |
+
$accordions_options['body']['padding'] = '';
|
86 |
+
$accordions_options['body']['margin'] = '';
|
87 |
+
|
88 |
+
|
89 |
+
$accordions_options['lazy_load'] = '';
|
90 |
+
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
+
$accordions_options['hide_edit'] = '';
|
94 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
98 |
+
$accordions_options['accordion']['enable_search'] = '';
|
99 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
+
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
+
$accordions_options['accordion']['is_child'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
//echo '<pre>'.var_export($post_content, true).'</pre>';
|
112 |
+
|
113 |
+
if( strpos($post_content, '[su_accordion') !== false){
|
114 |
+
$tabs = accordions_str_between_all($post_content, "[su_accordion", "[/su_accordion]");
|
115 |
+
|
116 |
+
if(!empty($tabs))
|
117 |
+
foreach ($tabs as $tab_content){
|
118 |
+
|
119 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='su_spoiler');
|
120 |
+
|
121 |
+
$i = 0;
|
122 |
+
|
123 |
+
if(!empty($shortcode_content))
|
124 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
125 |
+
|
126 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
127 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
128 |
+
|
129 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
130 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
131 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
132 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
133 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
134 |
+
|
135 |
+
$active_icon = '';
|
136 |
+
$inactive_icon = '';
|
137 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
138 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
139 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
140 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
141 |
+
|
142 |
+
$i++;
|
143 |
+
}
|
144 |
+
|
145 |
+
$accordions_id = wp_insert_post(
|
146 |
+
array(
|
147 |
+
'post_title' => 'su accordion',
|
148 |
+
'post_content' => '',
|
149 |
+
'post_status' => 'publish',
|
150 |
+
'post_type' => 'accordions',
|
151 |
+
'post_author' => 1,
|
152 |
+
)
|
153 |
+
);
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
if( strpos($post_content, '[su_tabs') !== false){
|
164 |
+
$tabs = accordions_str_between_all($post_content, "[su_tabs", "[/su_tabs]");
|
165 |
+
|
166 |
+
if(!empty($tabs))
|
167 |
+
foreach ($tabs as $tab_content){
|
168 |
+
|
169 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='su_tab');
|
170 |
+
|
171 |
+
$i = 0;
|
172 |
+
|
173 |
+
if(!empty($shortcode_content))
|
174 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
175 |
+
|
176 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
177 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
178 |
+
|
179 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
180 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
181 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
182 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
183 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
184 |
+
|
185 |
+
$active_icon = '';
|
186 |
+
$inactive_icon = '';
|
187 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
188 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
189 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
190 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
191 |
+
|
192 |
+
$i++;
|
193 |
+
}
|
194 |
+
|
195 |
+
$accordions_id = wp_insert_post(
|
196 |
+
array(
|
197 |
+
'post_title' => 'su tabs',
|
198 |
+
'post_content' => '',
|
199 |
+
'post_status' => 'publish',
|
200 |
+
'post_type' => 'accordions',
|
201 |
+
'post_author' => 1,
|
202 |
+
)
|
203 |
+
);
|
204 |
+
|
205 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
206 |
+
|
207 |
+
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
|
215 |
+
update_post_meta($post_id, 'import_done', 'done');
|
216 |
+
|
217 |
+
|
218 |
+
wp_reset_query();
|
219 |
+
wp_reset_postdata();
|
220 |
+
endwhile;
|
221 |
+
else:
|
222 |
+
|
223 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
224 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
225 |
+
|
226 |
+
wp_clear_scheduled_hook('accordions_import_cron_shortcodes_ultimate');
|
227 |
+
|
228 |
+
|
229 |
+
endif;
|
230 |
+
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
|
includes/3rd-party/sp-faq/functions-data-import.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_sp_faq', 'accordions_import_cron_sp_faq');
|
10 |
+
add_action('accordions_import_cron_sp_faq', 'accordions_import_cron_sp_faq');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_sp_faq(){
|
14 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
+
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=>'sp_faq',
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> -1,
|
27 |
+
//'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
$wp_query = new WP_Query($args);
|
32 |
+
|
33 |
+
|
34 |
+
if ( $wp_query->have_posts() ) :
|
35 |
+
|
36 |
+
$accordions_options = array();
|
37 |
+
|
38 |
+
|
39 |
+
$accordions_icons_plus = 'plus';
|
40 |
+
$accordions_icons_minus = 'minus';
|
41 |
+
|
42 |
+
|
43 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
44 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
45 |
+
|
46 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
47 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
48 |
+
$accordions_options['icon']['position'] = '';
|
49 |
+
$accordions_options['icon']['color'] = '';
|
50 |
+
$accordions_options['icon']['color_hover'] = '';
|
51 |
+
$accordions_options['icon']['font_size'] = '';
|
52 |
+
$accordions_options['icon']['background_color'] = '';
|
53 |
+
$accordions_options['icon']['padding'] = '';
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
$accordions_options['header']['class'] = '';
|
59 |
+
$accordions_options['header']['active_background_color'] = '';
|
60 |
+
$accordions_options['header']['background_color'] = '';
|
61 |
+
$accordions_options['header']['background_opacity'] = '';
|
62 |
+
$accordions_options['header']['color'] = '';
|
63 |
+
$accordions_options['header']['color_hover'] = '';
|
64 |
+
$accordions_options['header']['font_size'] = '';
|
65 |
+
$accordions_options['header']['font_family'] = '';
|
66 |
+
$accordions_options['header']['padding'] = '';
|
67 |
+
$accordions_options['header']['margin'] = '';
|
68 |
+
|
69 |
+
|
70 |
+
$accordions_options['body']['class'] = '';
|
71 |
+
|
72 |
+
$accordions_options['body']['active_background_color'] = '';
|
73 |
+
$accordions_options['body']['background_color'] = '';
|
74 |
+
$accordions_options['body']['background_opacity'] = '';
|
75 |
+
$accordions_options['body']['color'] = '';
|
76 |
+
$accordions_options['body']['font_size'] = '';
|
77 |
+
$accordions_options['body']['font_family'] = '';
|
78 |
+
$accordions_options['body']['padding'] = '';
|
79 |
+
$accordions_options['body']['margin'] = '';
|
80 |
+
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
$accordions_options['lazy_load'] = !empty($eap_preloader) ? 'yes' : 'no';
|
86 |
+
$accordions_options['lazy_load_src'] = '';
|
87 |
+
$accordions_options['hide_edit'] = '';
|
88 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
89 |
+
$accordions_options['accordion']['expanded_other'] = !empty($eap_mutliple_collapse) ? 'yes' : 'no';
|
90 |
+
$accordions_options['accordion']['height_style'] = !empty($eap_accordion_fillspace) ? 'content' : '';
|
91 |
+
|
92 |
+
|
93 |
+
$accordions_options['accordion']['active_event'] = '';
|
94 |
+
$accordions_options['accordion']['enable_search'] = '';
|
95 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
96 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
97 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
98 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
99 |
+
$accordions_options['accordion']['animate_style'] = '';
|
100 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
101 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
102 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
103 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
104 |
+
$accordions_options['accordion']['is_child'] = '';
|
105 |
+
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
$index = 0;
|
114 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
115 |
+
|
116 |
+
$post_id = get_the_id();
|
117 |
+
$post_title = get_the_title();
|
118 |
+
$post_content = get_the_content();
|
119 |
+
|
120 |
+
|
121 |
+
$accordions_options['content'][$index]['header'] = $post_title;
|
122 |
+
$accordions_options['content'][$index]['body'] = $post_content;
|
123 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
124 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
125 |
+
|
126 |
+
|
127 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
128 |
+
|
129 |
+
|
130 |
+
$accordions_options['content'][$index]['active_icon'] = '';
|
131 |
+
$accordions_options['content'][$index]['inactive_icon'] = '';
|
132 |
+
|
133 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
134 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
135 |
+
|
136 |
+
//update_post_meta($post_id, 'import_done', 'done');
|
137 |
+
|
138 |
+
$index++;
|
139 |
+
endwhile;
|
140 |
+
|
141 |
+
echo '<pre>'.var_export($accordions_options, true).'</pre>';
|
142 |
+
|
143 |
+
|
144 |
+
$post_data = array(
|
145 |
+
'post_title' => 'sp faq',
|
146 |
+
'post_content' => '',
|
147 |
+
'post_status' => 'publish',
|
148 |
+
'post_type' => 'accordions',
|
149 |
+
'post_author' => 1,
|
150 |
+
);
|
151 |
+
|
152 |
+
$accordions_id = wp_insert_post($post_data);
|
153 |
+
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
echo '##################';
|
159 |
+
echo '<br/>';
|
160 |
+
echo 'import done: '.$post_title;
|
161 |
+
echo '<br/>';
|
162 |
+
|
163 |
+
|
164 |
+
wp_reset_query();
|
165 |
+
wp_reset_postdata();
|
166 |
+
|
167 |
+
else:
|
168 |
+
|
169 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
170 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
171 |
+
|
172 |
+
wp_clear_scheduled_hook('accordions_import_cron_sp_faq');
|
173 |
+
|
174 |
+
|
175 |
+
endif;
|
176 |
+
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
|
includes/3rd-party/squelch-tabs-and-accordions-shortcodes/functions-data-import.php
ADDED
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_squelch_tabs_accordions', 'accordions_import_cron_squelch_tabs_accordions');
|
10 |
+
add_action('accordions_import_cron_squelch_tabs_accordions', 'accordions_import_cron_squelch_tabs_accordions');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_squelch_tabs_accordions(){
|
14 |
+
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=> array( 'page', 'post' ),
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 10,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
41 |
+
|
42 |
+
$accordions_options = array();
|
43 |
+
|
44 |
+
echo '<pre>'.var_export($post_title, true).'</pre>';
|
45 |
+
|
46 |
+
$accordions_icons_plus = 'plus';
|
47 |
+
$accordions_icons_minus = 'minus';
|
48 |
+
|
49 |
+
|
50 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
51 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
52 |
+
|
53 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
+
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
+
$accordions_options['icon']['background_color'] = '';
|
60 |
+
$accordions_options['icon']['padding'] = '';
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
$accordions_options['header']['class'] = '';
|
66 |
+
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
+
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
+
$accordions_options['header']['color_hover'] = '';
|
71 |
+
$accordions_options['header']['font_size'] = '';
|
72 |
+
$accordions_options['header']['font_family'] = '';
|
73 |
+
$accordions_options['header']['padding'] = '';
|
74 |
+
$accordions_options['header']['margin'] = '';
|
75 |
+
|
76 |
+
|
77 |
+
$accordions_options['body']['class'] = '';
|
78 |
+
|
79 |
+
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
+
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
+
$accordions_options['body']['font_size'] = '';
|
84 |
+
$accordions_options['body']['font_family'] = '';
|
85 |
+
$accordions_options['body']['padding'] = '';
|
86 |
+
$accordions_options['body']['margin'] = '';
|
87 |
+
|
88 |
+
|
89 |
+
$accordions_options['lazy_load'] = '';
|
90 |
+
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
+
$accordions_options['hide_edit'] = '';
|
94 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
98 |
+
$accordions_options['accordion']['enable_search'] = '';
|
99 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
+
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
+
$accordions_options['accordion']['is_child'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
//echo '<pre>'.var_export($post_content, true).'</pre>';
|
112 |
+
|
113 |
+
if( strpos($post_content, '[accordions') !== false){
|
114 |
+
$tabs = accordions_str_between_all($post_content, "[accordions", "[/accordions]");
|
115 |
+
|
116 |
+
if(!empty($tabs))
|
117 |
+
foreach ($tabs as $tab_content){
|
118 |
+
|
119 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='accordion');
|
120 |
+
|
121 |
+
$i = 0;
|
122 |
+
|
123 |
+
if(!empty($shortcode_content))
|
124 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
125 |
+
|
126 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
127 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
128 |
+
|
129 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
130 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
131 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
132 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
133 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
134 |
+
|
135 |
+
$active_icon = '';
|
136 |
+
$inactive_icon = '';
|
137 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
138 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
139 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
140 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
141 |
+
|
142 |
+
$i++;
|
143 |
+
}
|
144 |
+
|
145 |
+
$accordions_id = wp_insert_post(
|
146 |
+
array(
|
147 |
+
'post_title' => 'squelch accordion',
|
148 |
+
'post_content' => '',
|
149 |
+
'post_status' => 'publish',
|
150 |
+
'post_type' => 'accordions',
|
151 |
+
'post_author' => 1,
|
152 |
+
)
|
153 |
+
);
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
if( strpos($post_content, '[tabs') !== false){
|
164 |
+
$tabs = accordions_str_between_all($post_content, "[tabs", "[/tabs]");
|
165 |
+
|
166 |
+
if(!empty($tabs))
|
167 |
+
foreach ($tabs as $tab_content){
|
168 |
+
|
169 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='tab');
|
170 |
+
|
171 |
+
$i = 0;
|
172 |
+
|
173 |
+
if(!empty($shortcode_content))
|
174 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
175 |
+
|
176 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
177 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
178 |
+
|
179 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
180 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
181 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
182 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
183 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
184 |
+
|
185 |
+
$active_icon = '';
|
186 |
+
$inactive_icon = '';
|
187 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
188 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
189 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
190 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
191 |
+
|
192 |
+
$i++;
|
193 |
+
}
|
194 |
+
|
195 |
+
$accordions_id = wp_insert_post(
|
196 |
+
array(
|
197 |
+
'post_title' => 'squelch tabs',
|
198 |
+
'post_content' => '',
|
199 |
+
'post_status' => 'publish',
|
200 |
+
'post_type' => 'accordions',
|
201 |
+
'post_author' => 1,
|
202 |
+
)
|
203 |
+
);
|
204 |
+
|
205 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
206 |
+
|
207 |
+
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
if( strpos($post_content, '[haccordions') !== false){
|
214 |
+
$tabs = accordions_str_between_all($post_content, "[haccordions", "[/haccordions]");
|
215 |
+
|
216 |
+
if(!empty($tabs))
|
217 |
+
foreach ($tabs as $tab_content){
|
218 |
+
|
219 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='haccordion');
|
220 |
+
|
221 |
+
$i = 0;
|
222 |
+
|
223 |
+
if(!empty($shortcode_content))
|
224 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
225 |
+
|
226 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
227 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
228 |
+
|
229 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
230 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
231 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
232 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
233 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
234 |
+
|
235 |
+
$active_icon = '';
|
236 |
+
$inactive_icon = '';
|
237 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
238 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
239 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
240 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
241 |
+
|
242 |
+
$i++;
|
243 |
+
}
|
244 |
+
|
245 |
+
$accordions_id = wp_insert_post(
|
246 |
+
array(
|
247 |
+
'post_title' => 'squelch haccordion',
|
248 |
+
'post_content' => '',
|
249 |
+
'post_status' => 'publish',
|
250 |
+
'post_type' => 'accordions',
|
251 |
+
'post_author' => 1,
|
252 |
+
)
|
253 |
+
);
|
254 |
+
|
255 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
256 |
+
|
257 |
+
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
|
262 |
+
|
263 |
+
|
264 |
+
update_post_meta($post_id, 'import_done', 'done');
|
265 |
+
|
266 |
+
|
267 |
+
wp_reset_query();
|
268 |
+
wp_reset_postdata();
|
269 |
+
endwhile;
|
270 |
+
else:
|
271 |
+
|
272 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
273 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
274 |
+
|
275 |
+
wp_clear_scheduled_hook('accordions_import_cron_squelch_tabs_accordions');
|
276 |
+
|
277 |
+
|
278 |
+
endif;
|
279 |
+
|
280 |
+
|
281 |
+
}
|
282 |
+
|
283 |
+
|
284 |
+
|
285 |
+
|
includes/3rd-party/tabby-responsive-tabs/functions-data-import.php
CHANGED
@@ -6,29 +6,29 @@ if ( ! defined('ABSPATH')) exit; // if direct access
|
|
6 |
|
7 |
|
8 |
|
9 |
-
add_shortcode('
|
10 |
-
add_action('
|
11 |
|
12 |
|
13 |
-
function
|
14 |
-
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
|
|
|
16 |
$meta_query = array();
|
17 |
|
18 |
-
|
19 |
'key' => 'import_done',
|
20 |
'compare' => 'NOT EXISTS'
|
21 |
);
|
22 |
|
23 |
$args = array(
|
24 |
-
'post_type'=>'
|
25 |
'post_status'=>'publish',
|
26 |
-
'posts_per_page'=>
|
27 |
'meta_query'=> $meta_query,
|
28 |
-
|
29 |
);
|
30 |
|
31 |
|
|
|
32 |
$wp_query = new WP_Query($args);
|
33 |
|
34 |
|
@@ -37,35 +37,11 @@ function accordions_import_cron_easy_tabby_responsive_tabs(){
|
|
37 |
|
38 |
$post_id = get_the_id();
|
39 |
$post_title = get_the_title();
|
40 |
-
$
|
41 |
-
|
42 |
-
//echo $accordions_title.'<br/>';
|
43 |
-
$sp_eap_upload_options = get_post_meta( $post_id, 'sp_eap_upload_options', true );
|
44 |
-
$sp_eap_shortcode_options = get_post_meta( $post_id, 'sp_eap_shortcode_options', true );
|
45 |
-
|
46 |
-
$eap_accordion_type = $sp_eap_upload_options['eap_accordion_type'];
|
47 |
-
$accordion_content_source = $sp_eap_upload_options['accordion_content_source'];
|
48 |
-
|
49 |
-
|
50 |
-
echo '<pre>'.var_export($accordion_content_source, ture).'</pre>';
|
51 |
-
|
52 |
-
|
53 |
-
$eap_accordion_event = $sp_eap_shortcode_options['eap_accordion_event'];
|
54 |
-
$eap_mutliple_collapse = $sp_eap_shortcode_options['eap_mutliple_collapse'];
|
55 |
-
$eap_accordion_fillspace = $sp_eap_shortcode_options['eap_accordion_fillspace'];
|
56 |
-
$eap_preloader = $sp_eap_shortcode_options['eap_preloader'];
|
57 |
-
|
58 |
-
$eap_animation_time = $sp_eap_shortcode_options['eap_animation_time'];
|
59 |
-
$eap_icon_size = $sp_eap_shortcode_options['eap_icon_size']['all'];
|
60 |
-
$eap_icon_color_set = $sp_eap_shortcode_options['eap_icon_color_set'];
|
61 |
-
$eap_icon_position = $sp_eap_shortcode_options['eap_icon_position'];
|
62 |
-
$eap_title_color = $sp_eap_shortcode_options['eap_title_color'];
|
63 |
-
$eap_header_bg_color = $sp_eap_shortcode_options['eap_header_bg_color'];
|
64 |
-
$eap_description_color = $sp_eap_shortcode_options['eap_description_color'];
|
65 |
-
$eap_description_bg_color = $sp_eap_shortcode_options['eap_description_bg_color'];
|
66 |
-
|
67 |
|
|
|
68 |
|
|
|
69 |
|
70 |
$accordions_icons_plus = 'plus';
|
71 |
$accordions_icons_minus = 'minus';
|
@@ -76,10 +52,10 @@ function accordions_import_cron_easy_tabby_responsive_tabs(){
|
|
76 |
|
77 |
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
78 |
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
79 |
-
$accordions_options['icon']['position'] =
|
80 |
-
$accordions_options['icon']['color'] =
|
81 |
$accordions_options['icon']['color_hover'] = '';
|
82 |
-
$accordions_options['icon']['font_size'] =
|
83 |
$accordions_options['icon']['background_color'] = '';
|
84 |
$accordions_options['icon']['padding'] = '';
|
85 |
|
@@ -88,9 +64,9 @@ function accordions_import_cron_easy_tabby_responsive_tabs(){
|
|
88 |
|
89 |
$accordions_options['header']['class'] = '';
|
90 |
$accordions_options['header']['active_background_color'] = '';
|
91 |
-
$accordions_options['header']['background_color'] =
|
92 |
$accordions_options['header']['background_opacity'] = '';
|
93 |
-
$accordions_options['header']['color'] =
|
94 |
$accordions_options['header']['color_hover'] = '';
|
95 |
$accordions_options['header']['font_size'] = '';
|
96 |
$accordions_options['header']['font_family'] = '';
|
@@ -101,109 +77,115 @@ function accordions_import_cron_easy_tabby_responsive_tabs(){
|
|
101 |
$accordions_options['body']['class'] = '';
|
102 |
|
103 |
$accordions_options['body']['active_background_color'] = '';
|
104 |
-
$accordions_options['body']['background_color'] =
|
105 |
$accordions_options['body']['background_opacity'] = '';
|
106 |
-
$accordions_options['body']['color'] =
|
107 |
$accordions_options['body']['font_size'] = '';
|
108 |
$accordions_options['body']['font_family'] = '';
|
109 |
$accordions_options['body']['padding'] = '';
|
110 |
$accordions_options['body']['margin'] = '';
|
111 |
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
$accordions_options['lazy_load'] = !empty($eap_preloader) ? 'yes' : 'no';
|
117 |
$accordions_options['lazy_load_src'] = '';
|
|
|
|
|
118 |
$accordions_options['hide_edit'] = '';
|
119 |
$accordions_options['accordion']['collapsible'] = 'true';
|
120 |
-
$accordions_options['accordion']['expanded_other'] =
|
121 |
-
$accordions_options['accordion']['height_style'] =
|
122 |
-
|
123 |
-
if($eap_accordion_event == 'ea-click'){
|
124 |
-
$active_event = 'click';
|
125 |
-
}elseif ($eap_accordion_event == 'ea-hover'){
|
126 |
-
$active_event = 'mouseover';
|
127 |
-
}else{
|
128 |
-
$active_event = 'click';
|
129 |
-
}
|
130 |
-
|
131 |
-
$accordions_options['accordion']['active_event'] = $active_event;
|
132 |
$accordions_options['accordion']['enable_search'] = '';
|
133 |
$accordions_options['accordion']['search_placeholder_text'] = '';
|
134 |
$accordions_options['accordion']['click_scroll_top'] = '';
|
135 |
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
136 |
$accordions_options['accordion']['header_toggle'] = '';
|
137 |
$accordions_options['accordion']['animate_style'] = '';
|
138 |
-
$accordions_options['accordion']['animate_delay'] =
|
139 |
$accordions_options['accordion']['expand_collapse_display'] = '';
|
140 |
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
141 |
$accordions_options['accordion']['expand_collapse_text'] = '';
|
142 |
$accordions_options['accordion']['is_child'] = '';
|
143 |
|
144 |
|
|
|
145 |
|
|
|
|
|
146 |
|
|
|
147 |
|
|
|
|
|
148 |
|
|
|
149 |
|
150 |
|
|
|
|
|
151 |
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
$accordion_content_title = $accordion_single_data['accordion_content_title'];
|
159 |
-
$accordion_content_description = $accordion_single_data['accordion_content_description'];
|
160 |
|
161 |
|
|
|
162 |
|
|
|
|
|
163 |
|
|
|
|
|
164 |
|
165 |
-
|
|
|
|
|
|
|
|
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
|
|
|
|
|
|
170 |
|
|
|
|
|
171 |
|
172 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
|
|
|
174 |
|
175 |
-
$accordions_options['content'][$index]['active_icon'] = '';
|
176 |
-
$accordions_options['content'][$index]['inactive_icon'] = '';
|
177 |
|
178 |
-
$accordions_options['content'][$index]['background_color'] = '';
|
179 |
-
$accordions_options['content'][$index]['background_img'] = '';
|
180 |
-
|
181 |
-
$i++;
|
182 |
}
|
|
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
-
$post_data = array(
|
188 |
-
'post_title' => $post_title,
|
189 |
-
'post_content' => '',
|
190 |
-
'post_status' => 'publish',
|
191 |
-
'post_type' => 'accordions',
|
192 |
-
'post_author' => 1,
|
193 |
-
);
|
194 |
|
195 |
-
$accordions_id = wp_insert_post($post_data);
|
196 |
|
197 |
|
198 |
-
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
199 |
update_post_meta($post_id, 'import_done', 'done');
|
200 |
|
201 |
|
202 |
-
echo '##################';
|
203 |
-
echo '<br/>';
|
204 |
-
echo 'import done: '.$post_title;
|
205 |
-
echo '<br/>';
|
206 |
-
|
207 |
wp_reset_query();
|
208 |
wp_reset_postdata();
|
209 |
endwhile;
|
@@ -212,7 +194,7 @@ function accordions_import_cron_easy_tabby_responsive_tabs(){
|
|
212 |
$accordions_plugin_info['3rd_party_import'] = 'done';
|
213 |
update_option('accordions_plugin_info', $accordions_plugin_info);
|
214 |
|
215 |
-
wp_clear_scheduled_hook('
|
216 |
|
217 |
|
218 |
endif;
|
6 |
|
7 |
|
8 |
|
9 |
+
add_shortcode('accordions_import_cron_tabby_responsive_tabs', 'accordions_import_cron_tabby_responsive_tabs');
|
10 |
+
add_action('accordions_import_cron_tabby_responsive_tabs', 'accordions_import_cron_tabby_responsive_tabs');
|
11 |
|
12 |
|
13 |
+
function accordions_import_cron_tabby_responsive_tabs(){
|
|
|
14 |
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
$meta_query = array();
|
17 |
|
18 |
+
$meta_query[] = array(
|
19 |
'key' => 'import_done',
|
20 |
'compare' => 'NOT EXISTS'
|
21 |
);
|
22 |
|
23 |
$args = array(
|
24 |
+
'post_type'=> array( 'page','post' ),
|
25 |
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 3,
|
27 |
'meta_query'=> $meta_query,
|
|
|
28 |
);
|
29 |
|
30 |
|
31 |
+
|
32 |
$wp_query = new WP_Query($args);
|
33 |
|
34 |
|
37 |
|
38 |
$post_id = get_the_id();
|
39 |
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
+
$accordions_options = array();
|
43 |
|
44 |
+
echo '<pre>'.var_export($post_title, true).'</pre>';
|
45 |
|
46 |
$accordions_icons_plus = 'plus';
|
47 |
$accordions_icons_minus = 'minus';
|
52 |
|
53 |
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
$accordions_options['icon']['background_color'] = '';
|
60 |
$accordions_options['icon']['padding'] = '';
|
61 |
|
64 |
|
65 |
$accordions_options['header']['class'] = '';
|
66 |
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
$accordions_options['header']['color_hover'] = '';
|
71 |
$accordions_options['header']['font_size'] = '';
|
72 |
$accordions_options['header']['font_family'] = '';
|
77 |
$accordions_options['body']['class'] = '';
|
78 |
|
79 |
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
$accordions_options['body']['font_size'] = '';
|
84 |
$accordions_options['body']['font_family'] = '';
|
85 |
$accordions_options['body']['padding'] = '';
|
86 |
$accordions_options['body']['margin'] = '';
|
87 |
|
88 |
|
89 |
+
$accordions_options['lazy_load'] = '';
|
|
|
|
|
|
|
90 |
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
$accordions_options['hide_edit'] = '';
|
94 |
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
$accordions_options['accordion']['enable_search'] = '';
|
99 |
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
$accordions_options['accordion']['is_child'] = '';
|
109 |
|
110 |
|
111 |
+
//echo '<pre>'.var_export($post_content, true).'</pre>';
|
112 |
|
113 |
+
if( strpos($post_content, '[tabbyending') !== false){
|
114 |
+
$tabs = accordions_str_between_all($post_content, "[tabby", "[tabbyending]");
|
115 |
|
116 |
+
echo '<pre>'.var_export($tabs, true).'</pre>';
|
117 |
|
118 |
+
if(!empty($tabs))
|
119 |
+
foreach ($tabs as $tab_content){
|
120 |
|
121 |
+
//$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='tabby');
|
122 |
|
123 |
|
124 |
+
$tab_content = explode('title=', $tab_content);
|
125 |
+
unset($tab_content[0]);
|
126 |
|
127 |
+
//
|
128 |
+
$i = 0;
|
129 |
+
foreach ($tab_content as $tab){
|
130 |
+
$tab_content = explode(']', $tab);
|
131 |
+
$tab_content = str_replace('[tabby','', $tab_content);
|
132 |
|
133 |
+
//echo '<pre>'.var_export($tab_content, true).'</pre>';
|
134 |
+
$shortcode_content[$i]['title'] = str_replace('"','',$tab_content[0]);
|
135 |
+
$shortcode_content[$i]['content'] = $tab_content[1];
|
136 |
+
$i++;
|
137 |
+
}
|
|
|
|
|
138 |
|
139 |
|
140 |
+
$i = 0;
|
141 |
|
142 |
+
if(!empty($shortcode_content))
|
143 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
144 |
|
145 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
146 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
147 |
|
148 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
149 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
150 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
151 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
152 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
153 |
|
154 |
+
$active_icon = '';
|
155 |
+
$inactive_icon = '';
|
156 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
157 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
158 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
159 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
160 |
|
161 |
+
$i++;
|
162 |
+
}
|
163 |
|
164 |
+
$accordions_id = wp_insert_post(
|
165 |
+
array(
|
166 |
+
'post_title' => 'tabby responsive tabs',
|
167 |
+
'post_content' => '',
|
168 |
+
'post_status' => 'publish',
|
169 |
+
'post_type' => 'accordions',
|
170 |
+
'post_author' => 1,
|
171 |
+
)
|
172 |
+
);
|
173 |
|
174 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
175 |
|
|
|
|
|
176 |
|
|
|
|
|
|
|
|
|
177 |
}
|
178 |
+
}
|
179 |
|
180 |
|
181 |
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
|
|
|
184 |
|
185 |
|
|
|
186 |
update_post_meta($post_id, 'import_done', 'done');
|
187 |
|
188 |
|
|
|
|
|
|
|
|
|
|
|
189 |
wp_reset_query();
|
190 |
wp_reset_postdata();
|
191 |
endwhile;
|
194 |
$accordions_plugin_info['3rd_party_import'] = 'done';
|
195 |
update_option('accordions_plugin_info', $accordions_plugin_info);
|
196 |
|
197 |
+
wp_clear_scheduled_hook('accordions_import_cron_tabby_responsive_tabs');
|
198 |
|
199 |
|
200 |
endif;
|
includes/3rd-party/tabs-pro/functions-data-import.php
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_tabs_pro', 'accordions_import_cron_tabs_pro');
|
10 |
+
add_action('accordions_import_cron_tabs_pro', 'accordions_import_cron_tabs_pro');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_tabs_pro(){
|
14 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
+
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=>'tp_tab_pro',
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 1,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
|
29 |
+
);
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$accordions_options = array();
|
41 |
+
|
42 |
+
//echo $accordions_title.'<br/>';
|
43 |
+
$custom_accordion_wordpresspro_columns = get_post_meta( $post_id, 'custom_accordion_wordpresspro_columns' );
|
44 |
+
|
45 |
+
echo '<pre>'.var_export($custom_accordion_wordpresspro_columns, ture).'</pre>';
|
46 |
+
|
47 |
+
$accordions_icons_plus = 'plus';
|
48 |
+
$accordions_icons_minus = 'minus';
|
49 |
+
|
50 |
+
|
51 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
52 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
53 |
+
|
54 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
55 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
56 |
+
$accordions_options['icon']['position'] = '';
|
57 |
+
$accordions_options['icon']['color'] = '';
|
58 |
+
$accordions_options['icon']['color_hover'] = '';
|
59 |
+
$accordions_options['icon']['font_size'] = '';
|
60 |
+
$accordions_options['icon']['background_color'] = '';
|
61 |
+
$accordions_options['icon']['padding'] = '';
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
$accordions_options['header']['class'] = '';
|
67 |
+
$accordions_options['header']['active_background_color'] = '';
|
68 |
+
$accordions_options['header']['background_color'] = '';
|
69 |
+
$accordions_options['header']['background_opacity'] = '';
|
70 |
+
$accordions_options['header']['color'] = '';
|
71 |
+
$accordions_options['header']['color_hover'] = '';
|
72 |
+
$accordions_options['header']['font_size'] = '';
|
73 |
+
$accordions_options['header']['font_family'] = '';
|
74 |
+
$accordions_options['header']['padding'] = '';
|
75 |
+
$accordions_options['header']['margin'] = '';
|
76 |
+
|
77 |
+
|
78 |
+
$accordions_options['body']['class'] = '';
|
79 |
+
|
80 |
+
$accordions_options['body']['active_background_color'] = '';
|
81 |
+
$accordions_options['body']['background_color'] = '';
|
82 |
+
$accordions_options['body']['background_opacity'] = '';
|
83 |
+
$accordions_options['body']['color'] = '';
|
84 |
+
$accordions_options['body']['font_size'] = '';
|
85 |
+
$accordions_options['body']['font_family'] = '';
|
86 |
+
$accordions_options['body']['padding'] = '';
|
87 |
+
$accordions_options['body']['margin'] = '';
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
$accordions_options['lazy_load'] = 'yes';
|
94 |
+
$accordions_options['lazy_load_src'] = '';
|
95 |
+
$accordions_options['hide_edit'] = '';
|
96 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
97 |
+
$accordions_options['accordion']['expanded_other'] = !empty($eap_mutliple_collapse) ? 'yes' : 'no';
|
98 |
+
$accordions_options['accordion']['height_style'] = !empty($eap_accordion_fillspace) ? 'content' : '';
|
99 |
+
|
100 |
+
|
101 |
+
|
102 |
+
$accordions_options['accordion']['active_event'] = '';
|
103 |
+
$accordions_options['accordion']['enable_search'] = '';
|
104 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
105 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
106 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
107 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
108 |
+
$accordions_options['accordion']['animate_style'] = '';
|
109 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
110 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
111 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
112 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
113 |
+
$accordions_options['accordion']['is_child'] = '';
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
$i = 0;
|
119 |
+
|
120 |
+
if(!empty($custom_accordion_wordpresspro_columns))
|
121 |
+
foreach ($custom_accordion_wordpresspro_columns as $index => $accordion_single_data){
|
122 |
+
|
123 |
+
$accordion_content_title = $accordion_single_data['custom_accordions_pro_title'];
|
124 |
+
$accordion_content_description = $accordion_single_data['custom_accordions_pro_details'];
|
125 |
+
$icon = $accordion_single_data['field-14'];
|
126 |
+
|
127 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$icon.'"></i>' : '<i class="fa fa-plus"></i>';
|
128 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$icon.'"></i>' : '<i class="fa fa-minus"></i>';
|
129 |
+
|
130 |
+
|
131 |
+
|
132 |
+
$accordions_options['content'][$index]['header'] = $accordion_content_title;
|
133 |
+
$accordions_options['content'][$index]['body'] = $accordion_content_description;
|
134 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
135 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
136 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
137 |
+
$accordions_options['content'][$index]['active_icon'] = $icon;
|
138 |
+
$accordions_options['content'][$index]['inactive_icon'] = $icon;
|
139 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
140 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
141 |
+
|
142 |
+
$i++;
|
143 |
+
}
|
144 |
+
|
145 |
+
|
146 |
+
echo '<pre>'.var_export($accordions_options, ture).'</pre>';
|
147 |
+
|
148 |
+
|
149 |
+
$post_data = array(
|
150 |
+
'post_title' => $post_title,
|
151 |
+
'post_content' => '',
|
152 |
+
'post_status' => 'publish',
|
153 |
+
'post_type' => 'accordions',
|
154 |
+
'post_author' => 1,
|
155 |
+
);
|
156 |
+
|
157 |
+
$accordions_id = wp_insert_post($post_data);
|
158 |
+
|
159 |
+
|
160 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
161 |
+
update_post_meta($post_id, 'import_done', 'done');
|
162 |
+
|
163 |
+
|
164 |
+
echo '##################';
|
165 |
+
echo '<br/>';
|
166 |
+
echo 'import done: '.$post_title;
|
167 |
+
echo '<br/>';
|
168 |
+
|
169 |
+
wp_reset_query();
|
170 |
+
wp_reset_postdata();
|
171 |
+
endwhile;
|
172 |
+
else:
|
173 |
+
|
174 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
175 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
176 |
+
|
177 |
+
wp_clear_scheduled_hook('accordions_import_cron_tabs_pro');
|
178 |
+
|
179 |
+
|
180 |
+
endif;
|
181 |
+
|
182 |
+
|
183 |
+
}
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
|
includes/3rd-party/tabs-shortcode/functions-data-import.php
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_tabs_shortcode', 'accordions_import_cron_tabs_shortcode');
|
10 |
+
add_action('accordions_import_cron_tabs_shortcode', 'accordions_import_cron_tabs_shortcode');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_tabs_shortcode(){
|
14 |
+
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done_tabs_shortcode',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=> array( 'page', 'post' ),
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 10,
|
27 |
+
//'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
41 |
+
|
42 |
+
$accordions_options = array();
|
43 |
+
|
44 |
+
echo '<pre>'.var_export($post_title, true).'</pre>';
|
45 |
+
|
46 |
+
$accordions_icons_plus = 'plus';
|
47 |
+
$accordions_icons_minus = 'minus';
|
48 |
+
|
49 |
+
|
50 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
51 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
52 |
+
|
53 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
+
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
+
$accordions_options['icon']['background_color'] = '';
|
60 |
+
$accordions_options['icon']['padding'] = '';
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
$accordions_options['header']['class'] = '';
|
66 |
+
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
+
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
+
$accordions_options['header']['color_hover'] = '';
|
71 |
+
$accordions_options['header']['font_size'] = '';
|
72 |
+
$accordions_options['header']['font_family'] = '';
|
73 |
+
$accordions_options['header']['padding'] = '';
|
74 |
+
$accordions_options['header']['margin'] = '';
|
75 |
+
|
76 |
+
|
77 |
+
$accordions_options['body']['class'] = '';
|
78 |
+
|
79 |
+
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
+
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
+
$accordions_options['body']['font_size'] = '';
|
84 |
+
$accordions_options['body']['font_family'] = '';
|
85 |
+
$accordions_options['body']['padding'] = '';
|
86 |
+
$accordions_options['body']['margin'] = '';
|
87 |
+
|
88 |
+
|
89 |
+
$accordions_options['lazy_load'] = '';
|
90 |
+
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
+
$accordions_options['hide_edit'] = '';
|
94 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
98 |
+
$accordions_options['accordion']['enable_search'] = '';
|
99 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
+
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
+
$accordions_options['accordion']['is_child'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
//echo '<pre>'.var_export($post_content, true).'</pre>';
|
112 |
+
|
113 |
+
if( strpos($post_content, '[tabs') !== false){
|
114 |
+
$tabs = accordions_str_between_all($post_content, "[tabs", "[/tabs]");
|
115 |
+
|
116 |
+
if(!empty($tabs))
|
117 |
+
foreach ($tabs as $tab_content){
|
118 |
+
|
119 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='tab');
|
120 |
+
|
121 |
+
$i = 0;
|
122 |
+
|
123 |
+
if(!empty($shortcode_content))
|
124 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
125 |
+
|
126 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
127 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
128 |
+
|
129 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
130 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
131 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
132 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
133 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
134 |
+
|
135 |
+
$active_icon = '';
|
136 |
+
$inactive_icon = '';
|
137 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
138 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
139 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
140 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
141 |
+
|
142 |
+
$i++;
|
143 |
+
}
|
144 |
+
|
145 |
+
$accordions_id = wp_insert_post(
|
146 |
+
array(
|
147 |
+
'post_title' => 'Tabs Shortcode',
|
148 |
+
'post_content' => '',
|
149 |
+
'post_status' => 'publish',
|
150 |
+
'post_type' => 'accordions',
|
151 |
+
'post_author' => 1,
|
152 |
+
)
|
153 |
+
);
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
update_post_meta($post_id, 'import_done_tabs_shortcode', 'done');
|
164 |
+
|
165 |
+
|
166 |
+
wp_reset_query();
|
167 |
+
wp_reset_postdata();
|
168 |
+
endwhile;
|
169 |
+
else:
|
170 |
+
|
171 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
172 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
173 |
+
|
174 |
+
wp_clear_scheduled_hook('accordions_import_cron_shortcodes_ultimate');
|
175 |
+
|
176 |
+
|
177 |
+
endif;
|
178 |
+
|
179 |
+
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
includes/3rd-party/ultimate-faqs/functions-data-import.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_ultimate_faqs', 'accordions_import_cron_ultimate_faqs');
|
10 |
+
add_action('accordions_import_cron_ultimate_faqs', 'accordions_import_cron_ultimate_faqs');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_ultimate_faqs(){
|
14 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
+
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=>'ufaq',
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> -1,
|
27 |
+
//'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
$wp_query = new WP_Query($args);
|
32 |
+
|
33 |
+
|
34 |
+
if ( $wp_query->have_posts() ) :
|
35 |
+
|
36 |
+
$accordions_options = array();
|
37 |
+
|
38 |
+
|
39 |
+
$accordions_icons_plus = 'plus';
|
40 |
+
$accordions_icons_minus = 'minus';
|
41 |
+
|
42 |
+
|
43 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
44 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
45 |
+
|
46 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
47 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
48 |
+
$accordions_options['icon']['position'] = '';
|
49 |
+
$accordions_options['icon']['color'] = '';
|
50 |
+
$accordions_options['icon']['color_hover'] = '';
|
51 |
+
$accordions_options['icon']['font_size'] = '';
|
52 |
+
$accordions_options['icon']['background_color'] = '';
|
53 |
+
$accordions_options['icon']['padding'] = '';
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
$accordions_options['header']['class'] = '';
|
59 |
+
$accordions_options['header']['active_background_color'] = '';
|
60 |
+
$accordions_options['header']['background_color'] = '';
|
61 |
+
$accordions_options['header']['background_opacity'] = '';
|
62 |
+
$accordions_options['header']['color'] = '';
|
63 |
+
$accordions_options['header']['color_hover'] = '';
|
64 |
+
$accordions_options['header']['font_size'] = '';
|
65 |
+
$accordions_options['header']['font_family'] = '';
|
66 |
+
$accordions_options['header']['padding'] = '';
|
67 |
+
$accordions_options['header']['margin'] = '';
|
68 |
+
|
69 |
+
|
70 |
+
$accordions_options['body']['class'] = '';
|
71 |
+
|
72 |
+
$accordions_options['body']['active_background_color'] = '';
|
73 |
+
$accordions_options['body']['background_color'] = '';
|
74 |
+
$accordions_options['body']['background_opacity'] = '';
|
75 |
+
$accordions_options['body']['color'] = '';
|
76 |
+
$accordions_options['body']['font_size'] = '';
|
77 |
+
$accordions_options['body']['font_family'] = '';
|
78 |
+
$accordions_options['body']['padding'] = '';
|
79 |
+
$accordions_options['body']['margin'] = '';
|
80 |
+
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
$accordions_options['lazy_load'] = !empty($eap_preloader) ? 'yes' : 'no';
|
86 |
+
$accordions_options['lazy_load_src'] = '';
|
87 |
+
$accordions_options['hide_edit'] = '';
|
88 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
89 |
+
$accordions_options['accordion']['expanded_other'] = !empty($eap_mutliple_collapse) ? 'yes' : 'no';
|
90 |
+
$accordions_options['accordion']['height_style'] = !empty($eap_accordion_fillspace) ? 'content' : '';
|
91 |
+
|
92 |
+
|
93 |
+
$accordions_options['accordion']['active_event'] = '';
|
94 |
+
$accordions_options['accordion']['enable_search'] = '';
|
95 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
96 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
97 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
98 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
99 |
+
$accordions_options['accordion']['animate_style'] = '';
|
100 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
101 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
102 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
103 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
104 |
+
$accordions_options['accordion']['is_child'] = '';
|
105 |
+
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
$index = 0;
|
114 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
115 |
+
|
116 |
+
$post_id = get_the_id();
|
117 |
+
$post_title = get_the_title();
|
118 |
+
$post_content = get_the_content();
|
119 |
+
|
120 |
+
|
121 |
+
$accordions_options['content'][$index]['header'] = $post_title;
|
122 |
+
$accordions_options['content'][$index]['body'] = $post_content;
|
123 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
124 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
125 |
+
|
126 |
+
|
127 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
128 |
+
|
129 |
+
|
130 |
+
$accordions_options['content'][$index]['active_icon'] = '';
|
131 |
+
$accordions_options['content'][$index]['inactive_icon'] = '';
|
132 |
+
|
133 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
134 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
135 |
+
|
136 |
+
update_post_meta($post_id, 'import_done', 'done');
|
137 |
+
|
138 |
+
$index++;
|
139 |
+
endwhile;
|
140 |
+
|
141 |
+
echo '<pre>'.var_export($accordions_options, true).'</pre>';
|
142 |
+
|
143 |
+
|
144 |
+
$post_data = array(
|
145 |
+
'post_title' => 'Ultimate FAQ',
|
146 |
+
'post_content' => '',
|
147 |
+
'post_status' => 'publish',
|
148 |
+
'post_type' => 'accordions',
|
149 |
+
'post_author' => 1,
|
150 |
+
);
|
151 |
+
|
152 |
+
$accordions_id = wp_insert_post($post_data);
|
153 |
+
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
echo '##################';
|
159 |
+
echo '<br/>';
|
160 |
+
echo 'import done: '.$post_title;
|
161 |
+
echo '<br/>';
|
162 |
+
|
163 |
+
|
164 |
+
wp_reset_query();
|
165 |
+
wp_reset_postdata();
|
166 |
+
|
167 |
+
else:
|
168 |
+
|
169 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
170 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
171 |
+
|
172 |
+
wp_clear_scheduled_hook('accordions_import_cron_ultimate_faqs');
|
173 |
+
|
174 |
+
|
175 |
+
endif;
|
176 |
+
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
|
includes/3rd-party/wc-shortcodes/functions-data-import.php
ADDED
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_wc_shortcodes', 'accordions_import_cron_wc_shortcodes');
|
10 |
+
add_action('accordions_import_cron_wc_shortcodes', 'accordions_import_cron_wc_shortcodes');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_wc_shortcodes(){
|
14 |
+
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=> array( 'page', 'post' ),
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 10,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
41 |
+
|
42 |
+
$accordions_options = array();
|
43 |
+
|
44 |
+
echo '<pre>'.var_export($post_title, true).'</pre>';
|
45 |
+
|
46 |
+
$accordions_icons_plus = 'plus';
|
47 |
+
$accordions_icons_minus = 'minus';
|
48 |
+
|
49 |
+
|
50 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
51 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
52 |
+
|
53 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
+
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
+
$accordions_options['icon']['background_color'] = '';
|
60 |
+
$accordions_options['icon']['padding'] = '';
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
$accordions_options['header']['class'] = '';
|
66 |
+
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
+
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
+
$accordions_options['header']['color_hover'] = '';
|
71 |
+
$accordions_options['header']['font_size'] = '';
|
72 |
+
$accordions_options['header']['font_family'] = '';
|
73 |
+
$accordions_options['header']['padding'] = '';
|
74 |
+
$accordions_options['header']['margin'] = '';
|
75 |
+
|
76 |
+
|
77 |
+
$accordions_options['body']['class'] = '';
|
78 |
+
|
79 |
+
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
+
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
+
$accordions_options['body']['font_size'] = '';
|
84 |
+
$accordions_options['body']['font_family'] = '';
|
85 |
+
$accordions_options['body']['padding'] = '';
|
86 |
+
$accordions_options['body']['margin'] = '';
|
87 |
+
|
88 |
+
|
89 |
+
$accordions_options['lazy_load'] = '';
|
90 |
+
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
+
$accordions_options['hide_edit'] = '';
|
94 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
98 |
+
$accordions_options['accordion']['enable_search'] = '';
|
99 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
+
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
+
$accordions_options['accordion']['is_child'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
//echo '<pre>'.var_export($post_content, true).'</pre>';
|
112 |
+
|
113 |
+
if( strpos($post_content, '[wc_accordion') !== false){
|
114 |
+
$tabs = accordions_str_between_all($post_content, "[wc_accordion", "[/wc_accordion]");
|
115 |
+
|
116 |
+
if(!empty($tabs))
|
117 |
+
foreach ($tabs as $tab_content){
|
118 |
+
|
119 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='wc_accordion_section');
|
120 |
+
|
121 |
+
$i = 0;
|
122 |
+
|
123 |
+
if(!empty($shortcode_content))
|
124 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
125 |
+
|
126 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
127 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
128 |
+
|
129 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
130 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
131 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
132 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
133 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
134 |
+
|
135 |
+
$active_icon = '';
|
136 |
+
$inactive_icon = '';
|
137 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
138 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
139 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
140 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
141 |
+
|
142 |
+
$i++;
|
143 |
+
}
|
144 |
+
|
145 |
+
$accordions_id = wp_insert_post(
|
146 |
+
array(
|
147 |
+
'post_title' => 'accordion',
|
148 |
+
'post_content' => '',
|
149 |
+
'post_status' => 'publish',
|
150 |
+
'post_type' => 'accordions',
|
151 |
+
'post_author' => 1,
|
152 |
+
)
|
153 |
+
);
|
154 |
+
|
155 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
156 |
+
|
157 |
+
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
if( strpos($post_content, '[wc_tabgroup') !== false){
|
164 |
+
$tabs = accordions_str_between_all($post_content, "[wc_tabgroup", "[/wc_tabgroup]");
|
165 |
+
|
166 |
+
if(!empty($tabs))
|
167 |
+
foreach ($tabs as $tab_content){
|
168 |
+
|
169 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='wc_tab');
|
170 |
+
|
171 |
+
$i = 0;
|
172 |
+
|
173 |
+
if(!empty($shortcode_content))
|
174 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
175 |
+
|
176 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
177 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
178 |
+
|
179 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
180 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
181 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
182 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
183 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
184 |
+
|
185 |
+
$active_icon = '';
|
186 |
+
$inactive_icon = '';
|
187 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
188 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
189 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
190 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
191 |
+
|
192 |
+
$i++;
|
193 |
+
}
|
194 |
+
|
195 |
+
$accordions_id = wp_insert_post(
|
196 |
+
array(
|
197 |
+
'post_title' => 'tabs',
|
198 |
+
'post_content' => '',
|
199 |
+
'post_status' => 'publish',
|
200 |
+
'post_type' => 'accordions',
|
201 |
+
'post_author' => 1,
|
202 |
+
)
|
203 |
+
);
|
204 |
+
|
205 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
206 |
+
|
207 |
+
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
|
215 |
+
update_post_meta($post_id, 'import_done', 'done');
|
216 |
+
|
217 |
+
|
218 |
+
wp_reset_query();
|
219 |
+
wp_reset_postdata();
|
220 |
+
endwhile;
|
221 |
+
else:
|
222 |
+
|
223 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
224 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
225 |
+
|
226 |
+
wp_clear_scheduled_hook('accordions_import_cron_shortcodes_ultimate');
|
227 |
+
|
228 |
+
|
229 |
+
endif;
|
230 |
+
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
|
includes/3rd-party/wonderplugin-tabs-trial/functions-data-import.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_wonderplugin_tabs_trial', 'accordions_import_cron_wonderplugin_tabs_trial');
|
10 |
+
add_action('accordions_import_cron_wonderplugin_tabs_trial', 'accordions_import_cron_wonderplugin_tabs_trial');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_wonderplugin_tabs_trial(){
|
14 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
global $wpdb;
|
19 |
+
$table_name = $wpdb->prefix . "wonderplugin_tabs";
|
20 |
+
$item_row = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $table_name") );
|
21 |
+
$results = $wpdb->get_results("SELECT * FROM $table_name", ARRAY_A);
|
22 |
+
|
23 |
+
//echo '<pre>'.var_export($results, true).'</pre>';
|
24 |
+
//echo '<pre>'.var_export('#########$results', true).'</pre>';
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
foreach ($results as $result){
|
29 |
+
|
30 |
+
$id = $result['id'];
|
31 |
+
$name = $result['name'];
|
32 |
+
$data= $result['data'];
|
33 |
+
$data = json_decode(trim($data));
|
34 |
+
$slides = $data->slides;
|
35 |
+
|
36 |
+
$accordions_options = array();
|
37 |
+
|
38 |
+
//echo '<pre>'.var_export($slides, true).'</pre>';
|
39 |
+
//echo '<pre>'.var_export('#########$slides', true).'</pre>';
|
40 |
+
|
41 |
+
$accordions_icons_plus = 'plus';
|
42 |
+
$accordions_icons_minus = 'minus';
|
43 |
+
|
44 |
+
|
45 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
46 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
47 |
+
|
48 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
49 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
50 |
+
$accordions_options['icon']['position'] = '';
|
51 |
+
$accordions_options['icon']['color'] = '';
|
52 |
+
$accordions_options['icon']['color_hover'] = '';
|
53 |
+
$accordions_options['icon']['font_size'] = '';
|
54 |
+
$accordions_options['icon']['background_color'] = '';
|
55 |
+
$accordions_options['icon']['padding'] = '';
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
$accordions_options['header']['class'] = '';
|
61 |
+
$accordions_options['header']['active_background_color'] = '';
|
62 |
+
$accordions_options['header']['background_color'] = '';
|
63 |
+
$accordions_options['header']['background_opacity'] = '';
|
64 |
+
$accordions_options['header']['color'] = '';
|
65 |
+
$accordions_options['header']['color_hover'] = '';
|
66 |
+
$accordions_options['header']['font_size'] = '';
|
67 |
+
$accordions_options['header']['font_family'] = '';
|
68 |
+
$accordions_options['header']['padding'] = '';
|
69 |
+
$accordions_options['header']['margin'] = '';
|
70 |
+
|
71 |
+
|
72 |
+
$accordions_options['body']['class'] = '';
|
73 |
+
|
74 |
+
$accordions_options['body']['active_background_color'] = '';
|
75 |
+
$accordions_options['body']['background_color'] = '';
|
76 |
+
$accordions_options['body']['background_opacity'] = '';
|
77 |
+
$accordions_options['body']['color'] = '';
|
78 |
+
$accordions_options['body']['font_size'] = '';
|
79 |
+
$accordions_options['body']['font_family'] = '';
|
80 |
+
$accordions_options['body']['padding'] = '';
|
81 |
+
$accordions_options['body']['margin'] = '';
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
$accordions_options['lazy_load'] ='yes';
|
88 |
+
$accordions_options['lazy_load_src'] = '';
|
89 |
+
$accordions_options['hide_edit'] = '';
|
90 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
91 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
92 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
$accordions_options['accordion']['active_event'] = '';
|
97 |
+
$accordions_options['accordion']['enable_search'] = '';
|
98 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
99 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
101 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
102 |
+
$accordions_options['accordion']['animate_style'] = '';
|
103 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
104 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
107 |
+
$accordions_options['accordion']['is_child'] = '';
|
108 |
+
|
109 |
+
|
110 |
+
//echo '<pre>'.var_export($slides, true).'</pre>';
|
111 |
+
|
112 |
+
|
113 |
+
foreach ($slides as $index=> $slide){
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
$tabtitle = $slide->tabtitle;
|
118 |
+
$tabcontent = $slide->tabcontent;
|
119 |
+
|
120 |
+
//echo '<pre>'.var_export($tabtitle, true).'</pre>';
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
$accordions_options['content'][$index]['header'] = $tabtitle;
|
125 |
+
$accordions_options['content'][$index]['body'] = $tabcontent;
|
126 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
127 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
128 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
129 |
+
$accordions_options['content'][$index]['active_icon'] = '';
|
130 |
+
$accordions_options['content'][$index]['inactive_icon'] = '';
|
131 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
132 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
133 |
+
}
|
134 |
+
|
135 |
+
echo '<pre>'.var_export($accordions_options, true).'</pre>';
|
136 |
+
|
137 |
+
$post_data = array(
|
138 |
+
'post_title' => $name,
|
139 |
+
'post_content' => '',
|
140 |
+
'post_status' => 'publish',
|
141 |
+
'post_type' => 'accordions',
|
142 |
+
'post_author' => 1,
|
143 |
+
);
|
144 |
+
|
145 |
+
$accordions_id = wp_insert_post($post_data);
|
146 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
147 |
+
|
148 |
+
|
149 |
+
|
150 |
+
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
|
155 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
156 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
157 |
+
|
158 |
+
wp_clear_scheduled_hook('accordions_import_cron_wonderplugin_tabs_trial');
|
159 |
+
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
|
167 |
+
|
includes/3rd-party/wp-shortcode/functions-data-import.php
ADDED
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
add_shortcode('accordions_import_cron_wp_shortcode', 'accordions_import_cron_wp_shortcode');
|
10 |
+
add_action('accordions_import_cron_wp_shortcode', 'accordions_import_cron_wp_shortcode');
|
11 |
+
|
12 |
+
|
13 |
+
function accordions_import_cron_wp_shortcode(){
|
14 |
+
|
15 |
+
$accordions_plugin_info = get_option('accordions_plugin_info');
|
16 |
+
$meta_query = array();
|
17 |
+
|
18 |
+
$meta_query[] = array(
|
19 |
+
'key' => 'import_done',
|
20 |
+
'compare' => 'NOT EXISTS'
|
21 |
+
);
|
22 |
+
|
23 |
+
$args = array(
|
24 |
+
'post_type'=> array( 'page', 'post' ),
|
25 |
+
'post_status'=>'publish',
|
26 |
+
'posts_per_page'=> 10,
|
27 |
+
'meta_query'=> $meta_query,
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$wp_query = new WP_Query($args);
|
33 |
+
|
34 |
+
|
35 |
+
if ( $wp_query->have_posts() ) :
|
36 |
+
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
37 |
+
|
38 |
+
$post_id = get_the_id();
|
39 |
+
$post_title = get_the_title();
|
40 |
+
$post_content = get_the_content();
|
41 |
+
|
42 |
+
$accordions_options = array();
|
43 |
+
|
44 |
+
echo '<pre>'.var_export($post_title, true).'</pre>';
|
45 |
+
|
46 |
+
$accordions_icons_plus = 'plus';
|
47 |
+
$accordions_icons_minus = 'minus';
|
48 |
+
|
49 |
+
|
50 |
+
$accordions_icons_plus = !empty($accordions_icons_plus) ? '<i class="fa fa-'.$accordions_icons_plus.'"></i>' : '<i class="fa fa-plus"></i>';
|
51 |
+
$accordions_icons_minus = !empty($accordions_icons_minus) ? '<i class="fa fa-'.$accordions_icons_minus.'"></i>' : '<i class="fa fa-minus"></i>';
|
52 |
+
|
53 |
+
$accordions_options['icon']['active'] = $accordions_icons_plus;
|
54 |
+
$accordions_options['icon']['inactive'] = $accordions_icons_minus;
|
55 |
+
$accordions_options['icon']['position'] = '';
|
56 |
+
$accordions_options['icon']['color'] = '';
|
57 |
+
$accordions_options['icon']['color_hover'] = '';
|
58 |
+
$accordions_options['icon']['font_size'] = '';
|
59 |
+
$accordions_options['icon']['background_color'] = '';
|
60 |
+
$accordions_options['icon']['padding'] = '';
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
$accordions_options['header']['class'] = '';
|
66 |
+
$accordions_options['header']['active_background_color'] = '';
|
67 |
+
$accordions_options['header']['background_color'] = '';
|
68 |
+
$accordions_options['header']['background_opacity'] = '';
|
69 |
+
$accordions_options['header']['color'] = '';
|
70 |
+
$accordions_options['header']['color_hover'] = '';
|
71 |
+
$accordions_options['header']['font_size'] = '';
|
72 |
+
$accordions_options['header']['font_family'] = '';
|
73 |
+
$accordions_options['header']['padding'] = '';
|
74 |
+
$accordions_options['header']['margin'] = '';
|
75 |
+
|
76 |
+
|
77 |
+
$accordions_options['body']['class'] = '';
|
78 |
+
|
79 |
+
$accordions_options['body']['active_background_color'] = '';
|
80 |
+
$accordions_options['body']['background_color'] = '';
|
81 |
+
$accordions_options['body']['background_opacity'] = '';
|
82 |
+
$accordions_options['body']['color'] = '';
|
83 |
+
$accordions_options['body']['font_size'] = '';
|
84 |
+
$accordions_options['body']['font_family'] = '';
|
85 |
+
$accordions_options['body']['padding'] = '';
|
86 |
+
$accordions_options['body']['margin'] = '';
|
87 |
+
|
88 |
+
|
89 |
+
$accordions_options['lazy_load'] = '';
|
90 |
+
$accordions_options['lazy_load_src'] = '';
|
91 |
+
$accordions_options['view_type'] = 'accordion';
|
92 |
+
|
93 |
+
$accordions_options['hide_edit'] = '';
|
94 |
+
$accordions_options['accordion']['collapsible'] = 'true';
|
95 |
+
$accordions_options['accordion']['expanded_other'] = '';
|
96 |
+
$accordions_options['accordion']['height_style'] = 'content';
|
97 |
+
$accordions_options['accordion']['active_event'] = 'click';
|
98 |
+
$accordions_options['accordion']['enable_search'] = '';
|
99 |
+
$accordions_options['accordion']['search_placeholder_text'] = '';
|
100 |
+
$accordions_options['accordion']['click_scroll_top'] = '';
|
101 |
+
$accordions_options['accordion']['click_scroll_top_offset'] = '';
|
102 |
+
$accordions_options['accordion']['header_toggle'] = '';
|
103 |
+
$accordions_options['accordion']['animate_style'] = '';
|
104 |
+
$accordions_options['accordion']['animate_delay'] = '';
|
105 |
+
$accordions_options['accordion']['expand_collapse_display'] = '';
|
106 |
+
$accordions_options['accordion']['expand_collapse_bg_color'] = '';
|
107 |
+
$accordions_options['accordion']['expand_collapse_text'] = '';
|
108 |
+
$accordions_options['accordion']['is_child'] = '';
|
109 |
+
|
110 |
+
|
111 |
+
//echo '<pre>'.var_export($post_content, true).'</pre>';
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
if( strpos($post_content, '[tabs') !== false){
|
116 |
+
$tabs = accordions_str_between_all($post_content, "[tabs", "[/tabs]");
|
117 |
+
|
118 |
+
if(!empty($tabs))
|
119 |
+
foreach ($tabs as $tab_content){
|
120 |
+
|
121 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='tab');
|
122 |
+
|
123 |
+
$i = 0;
|
124 |
+
|
125 |
+
if(!empty($shortcode_content))
|
126 |
+
foreach ($shortcode_content as $index => $accordion_single_data){
|
127 |
+
|
128 |
+
$acc_title = isset($accordion_single_data['title']) ? $accordion_single_data['title'] : '';
|
129 |
+
$acc_content = isset($accordion_single_data['content']) ? $accordion_single_data['content'] : '';
|
130 |
+
|
131 |
+
$accordions_options['content'][$index]['header'] = $acc_title;
|
132 |
+
$accordions_options['content'][$index]['body'] = $acc_content;
|
133 |
+
$accordions_options['content'][$index]['hide'] = 'no';
|
134 |
+
$accordions_options['content'][$index]['toggled_text'] = '';
|
135 |
+
$accordions_options['content'][$index]['is_active'] = '';
|
136 |
+
|
137 |
+
$active_icon = '';
|
138 |
+
$inactive_icon = '';
|
139 |
+
$accordions_options['content'][$index]['active_icon'] = $active_icon;
|
140 |
+
$accordions_options['content'][$index]['inactive_icon'] = $inactive_icon;
|
141 |
+
$accordions_options['content'][$index]['background_color'] = '';
|
142 |
+
$accordions_options['content'][$index]['background_img'] = '';
|
143 |
+
|
144 |
+
$i++;
|
145 |
+
}
|
146 |
+
|
147 |
+
$accordions_id = wp_insert_post(
|
148 |
+
array(
|
149 |
+
'post_title' => 'tabs',
|
150 |
+
'post_content' => '',
|
151 |
+
'post_status' => 'publish',
|
152 |
+
'post_type' => 'accordions',
|
153 |
+
'post_author' => 1,
|
154 |
+
)
|
155 |
+
);
|
156 |
+
|
157 |
+
update_post_meta($accordions_id, 'accordions_options', $accordions_options);
|
158 |
+
|
159 |
+
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
|
164 |
+
|
165 |
+
|
166 |
+
|
167 |
+
update_post_meta($post_id, 'import_done', 'done');
|
168 |
+
|
169 |
+
|
170 |
+
wp_reset_query();
|
171 |
+
wp_reset_postdata();
|
172 |
+
endwhile;
|
173 |
+
else:
|
174 |
+
|
175 |
+
$accordions_plugin_info['3rd_party_import'] = 'done';
|
176 |
+
update_option('accordions_plugin_info', $accordions_plugin_info);
|
177 |
+
|
178 |
+
wp_clear_scheduled_hook('accordions_import_cron_wp_shortcode');
|
179 |
+
|
180 |
+
|
181 |
+
endif;
|
182 |
+
|
183 |
+
|
184 |
+
}
|
185 |
+
|
186 |
+
|
187 |
+
|
188 |
+
|
includes/class-settings-hook.php
CHANGED
@@ -422,15 +422,41 @@ if(!function_exists('accordions_settings_content_3rd_party_import')) {
|
|
422 |
wp_schedule_event(time(), '1minute', 'accordions_import_cron_wpsm_ac');
|
423 |
}elseif($source == 'responsive-tabs'){
|
424 |
wp_schedule_event(time(), '1minute', 'accordions_import_cron_responsive_tabs');
|
425 |
-
}elseif($source == 'vc-tabs'){
|
426 |
-
wp_schedule_event(time(), '1minute', 'accordions_import_cron_vc_tabs');
|
427 |
}elseif($source == 'tabs-responsive'){
|
428 |
wp_schedule_event(time(), '1minute', 'accordions_import_cron_tabs_responsive');
|
429 |
}elseif($source == 'tabby-responsive-tabs'){
|
430 |
-
wp_schedule_event(time(), '1minute', '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
}
|
432 |
|
433 |
|
|
|
|
|
|
|
|
|
434 |
$_3rd_party_import_stats = 'processing';
|
435 |
}
|
436 |
|
@@ -458,15 +484,207 @@ if(!function_exists('accordions_settings_content_3rd_party_import')) {
|
|
458 |
|
459 |
?>
|
460 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
<!-- <p class="">Arconix FAQ - <a class="button button-primary" href="--><?php //echo $actionurl.'&source=arconix-faq'; ?><!--">Import data</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>-->
|
462 |
-
<p class="">Easy Accordion By ShapedPlugin - <a class="button button-primary" href="<?php echo $actionurl.'&source=easy-accordion-free'; ?>">Import data</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>
|
463 |
-
<p class="">Responsive Accordion And Collapse By wpshopmart - <a class="button button-primary" href="<?php echo $actionurl.'&source=responsive-accordion-and-collapse'; ?>">Import data</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>
|
464 |
-
<p class="">Tabs Responsive By wpshopmart - <a class="button button-primary" href="<?php echo $actionurl.'&source=tabs-responsive'; ?>">Import data</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>
|
465 |
-
<p class="">Responsive Tabs By WP Darko - <a class="button button-primary" href="<?php echo $actionurl.'&source=responsive-tabs'; ?>">Import data</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>
|
466 |
<!-- <p class="">Tabs By Biplob Adhikari - <a class="button button-primary" href="--><?php //echo $actionurl.'&source=vc-tabs'; ?><!--">Import data</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>-->
|
467 |
|
468 |
|
469 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
470 |
<?php
|
471 |
|
472 |
$html = ob_get_clean();
|
@@ -475,7 +693,7 @@ if(!function_exists('accordions_settings_content_3rd_party_import')) {
|
|
475 |
'id' => 'reset_migrate',
|
476 |
//'parent' => '',
|
477 |
'title' => __('Import data','accordions'),
|
478 |
-
'details' => '',
|
479 |
'type' => 'custom_html',
|
480 |
'html' => $html,
|
481 |
|
422 |
wp_schedule_event(time(), '1minute', 'accordions_import_cron_wpsm_ac');
|
423 |
}elseif($source == 'responsive-tabs'){
|
424 |
wp_schedule_event(time(), '1minute', 'accordions_import_cron_responsive_tabs');
|
|
|
|
|
425 |
}elseif($source == 'tabs-responsive'){
|
426 |
wp_schedule_event(time(), '1minute', 'accordions_import_cron_tabs_responsive');
|
427 |
}elseif($source == 'tabby-responsive-tabs'){
|
428 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_tabby_responsive_tabs');
|
429 |
+
}elseif($source == 'easy-responsive-tabs'){
|
430 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_easy_responsive_tabs');
|
431 |
+
}elseif($source == 'everest-tab-lite'){
|
432 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_everest_tab_lite');
|
433 |
+
}elseif($source == 'quick-and-easy-faqs'){
|
434 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_quick_easy_faqs');
|
435 |
+
}elseif($source == 'shortcodes-ultimate'){
|
436 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_shortcodes_ultimate');
|
437 |
+
}elseif($source == 'sp-faq'){
|
438 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_sp_faq');
|
439 |
+
}elseif($source == 'squelch-tabs-and-accordions-shortcodes'){
|
440 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_squelch_tabs_accordions');
|
441 |
+
}elseif($source == 'ultimate-faqs'){
|
442 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_ultimate_faqs');
|
443 |
+
}elseif($source == 'tabs-shortcode'){
|
444 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_tabs_shortcode');
|
445 |
+
}elseif($source == 'wonderplugin-tabs-trial'){
|
446 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_wonderplugin_tabs_trial');
|
447 |
+
}elseif($source == 'accordion-shortcodes'){
|
448 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_accordion_shortcodes');
|
449 |
+
}elseif($source == 'wp-shortcode'){
|
450 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_wp_shortcode');
|
451 |
+
}elseif($source == 'meks-flexible-shortcodes'){
|
452 |
+
wp_schedule_event(time(), '1minute', 'accordions_import_cron_meks_flexible_shortcodes');
|
453 |
}
|
454 |
|
455 |
|
456 |
+
|
457 |
+
|
458 |
+
|
459 |
+
|
460 |
$_3rd_party_import_stats = 'processing';
|
461 |
}
|
462 |
|
484 |
|
485 |
?>
|
486 |
|
487 |
+
<div class="import-source">
|
488 |
+
<div class="item">
|
489 |
+
<img src="https://ps.w.org/easy-accordion-free/assets/banner-772x250.png?rev=2031404">
|
490 |
+
<div class="">Easy Accordion</span></div>
|
491 |
+
<div class="">By ShapedPlugin</div>
|
492 |
+
|
493 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=easy-accordion-free'; ?>">Import data</a></p>
|
494 |
+
</div>
|
495 |
+
<div class="item">
|
496 |
+
<img src="https://ps.w.org/responsive-accordion-and-collapse/assets/banner-772x250.png?rev=2031404">
|
497 |
+
<div class="">Responsive Accordion And Collapse </div>
|
498 |
+
<div class="">By wpshopmart</div>
|
499 |
+
|
500 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=responsive-accordion-and-collapse'; ?>">Import data</a></p>
|
501 |
+
|
502 |
+
</div>
|
503 |
+
|
504 |
+
<div class="item">
|
505 |
+
<img src="https://ps.w.org/tabs-responsive/assets/banner-772x250.png?rev=2031404">
|
506 |
+
<div class="">Tabs Responsive </div>
|
507 |
+
<div class="">By wpshopmart</div>
|
508 |
+
|
509 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=tabs-responsive'; ?>">Import data</a></p>
|
510 |
+
|
511 |
+
</div>
|
512 |
+
|
513 |
+
<div class="item">
|
514 |
+
<img src="https://ps.w.org/responsive-tabs/assets/banner-772x250.png?rev=2031404">
|
515 |
+
<div class="">Responsive Tabs</div>
|
516 |
+
<div class="">By WP Darko</div>
|
517 |
+
|
518 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=responsive-tabs'; ?>">Import data</a></p>
|
519 |
+
|
520 |
+
</div>
|
521 |
+
|
522 |
+
<div class="item">
|
523 |
+
<img src="https://ps.w.org/easy-responsive-tabs/assets/banner-772x250.jpg?rev=789170">
|
524 |
+
<div class="">Easy Responsive Tabs </div>
|
525 |
+
<div class="">By oscitas</div>
|
526 |
+
|
527 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=easy-responsive-tabs'; ?>">Import data</a></p>
|
528 |
+
|
529 |
+
</div>
|
530 |
+
|
531 |
+
|
532 |
+
<div class="item">
|
533 |
+
<img src="https://ps.w.org/everest-tab-lite/assets/banner-772x250.png?rev=1810732">
|
534 |
+
<div class="">Everest Tab Lite</div>
|
535 |
+
<div class="">By AccessPress Themes</div>
|
536 |
+
|
537 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=everest-tab-lite'; ?>">Import data</a></p>
|
538 |
+
|
539 |
+
</div>
|
540 |
+
|
541 |
+
<div class="item">
|
542 |
+
<img src="https://ps.w.org/quick-and-easy-faqs/assets/banner-772x250.png?rev=2255173">
|
543 |
+
<div class="">Quick and Easy FAQs</div>
|
544 |
+
<div class="">By Inspiry Themes</div>
|
545 |
+
|
546 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=quick-and-easy-faqs'; ?>">Import data</a></p>
|
547 |
+
</div>
|
548 |
+
|
549 |
+
<div class="item">
|
550 |
+
<img src="https://ps.w.org/shortcodes-ultimate/assets/banner-772x250.jpg?rev=1760590">
|
551 |
+
<div class="">Shortcodes Ultimate</div>
|
552 |
+
<div class="">By Vladimir Anokhin</div>
|
553 |
+
|
554 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=shortcodes-ultimate'; ?>">Import data</a></p>
|
555 |
+
</div>
|
556 |
+
|
557 |
+
<div class="item">
|
558 |
+
<img src="https://ps.w.org/sp-faq/assets/banner-772x250.png?rev=1988830">
|
559 |
+
<div class="">WP responsive FAQ with category plugin</div>
|
560 |
+
<div class="">By WP OnlineSupport</div>
|
561 |
+
|
562 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=sp-faq'; ?>">Import data</a></p>
|
563 |
+
</div>
|
564 |
+
|
565 |
+
<div class="item">
|
566 |
+
<img src="https://ps.w.org/squelch-tabs-and-accordions-shortcodes/assets/banner-772x250.png?rev=1988830">
|
567 |
+
<div class="">Squelch Tabs and Accordions Shortcodes</div>
|
568 |
+
<div class="">By Matt Lowe</div>
|
569 |
+
|
570 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=squelch-tabs-and-accordions-shortcodes'; ?>">Import data</a></p>
|
571 |
+
</div>
|
572 |
+
|
573 |
+
<div class="item">
|
574 |
+
<img src="https://ps.w.org/tabby-responsive-tabs/assets/banner-772x250.jpg?rev=1485141">
|
575 |
+
<div class="">Tabby Responsive Tabs</div>
|
576 |
+
<div class="">By cubecolour</div>
|
577 |
+
|
578 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=tabby-responsive-tabs'; ?>">Import data</a></p>
|
579 |
+
</div>
|
580 |
+
|
581 |
+
<div class="item">
|
582 |
+
<img src="https://ps.w.org/ultimate-faqs/assets/banner-772x250.png?rev=1805913">
|
583 |
+
<div class="">Ultimate FAQ</div>
|
584 |
+
<div class="">By Etoile Web Design</div>
|
585 |
+
|
586 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=ultimate-faqs'; ?>">Import data</a></p>
|
587 |
+
</div>
|
588 |
+
|
589 |
+
<div class="item">
|
590 |
+
<img src="https://ps.w.org/tabs-pro/assets/banner-772x250.png?rev=1570543">
|
591 |
+
<div class="">Tab</div>
|
592 |
+
<div class="">By themepoints</div>
|
593 |
+
|
594 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=tabs-pro'; ?>">Import data</a></p>
|
595 |
+
</div>
|
596 |
+
|
597 |
+
<div class="item">
|
598 |
+
<img src="https://ps.w.org/accordion-shortcodes/assets/banner-772x250.png?rev=1570543">
|
599 |
+
<div class="">Accordion Shortcodes</div>
|
600 |
+
<div class="">By Phil Buchanan</div>
|
601 |
+
|
602 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=accordion-shortcodes'; ?>">Import data</a></p>
|
603 |
+
</div>
|
604 |
+
|
605 |
+
|
606 |
+
<div class="item">
|
607 |
+
<img src="https://ps.w.org/wc-shortcodes/assets/banner-772x250.jpg?rev=1585251">
|
608 |
+
<div class="">Shortcodes by Angie Makes</div>
|
609 |
+
<div class="">By Chris Baldelomar</div>
|
610 |
+
|
611 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=wc-shortcodes'; ?>">Import data</a></p>
|
612 |
+
</div>
|
613 |
+
|
614 |
+
|
615 |
+
<div class="item">
|
616 |
+
<img src="https://ps.w.org/wp-shortcode/assets/banner-772x250.png?rev=865700">
|
617 |
+
<div class="">WP Shortcode</div>
|
618 |
+
<div class="">By MyThemeShop</div>
|
619 |
+
|
620 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=wp-shortcode'; ?>">Import data</a></p>
|
621 |
+
</div>
|
622 |
+
|
623 |
+
<div class="item">
|
624 |
+
<img src="https://ps.w.org/arconix-faq/assets/banner-772x250.png?rev=1063597">
|
625 |
+
<div class="">Arconix FAQ</div>
|
626 |
+
<div class="">By Tyche Softwares</div>
|
627 |
+
|
628 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=arconix-faq'; ?>">Import data</a></p>
|
629 |
+
</div>
|
630 |
+
|
631 |
+
<div class="item">
|
632 |
+
<img src="https://ps.w.org/meks-flexible-shortcodes/assets/banner-772x250.jpg?rev=1927393">
|
633 |
+
<div class="">Meks Flexible Shortcodes</div>
|
634 |
+
<div class="">By Meks</div>
|
635 |
+
|
636 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=meks-flexible-shortcodes'; ?>">Import data</a></p>
|
637 |
+
</div>
|
638 |
+
|
639 |
+
|
640 |
+
<div class="item">
|
641 |
+
<img src="https://i.imgur.com/B79SCcW.png">
|
642 |
+
<div class="">Tabs Shortcode</div>
|
643 |
+
<div class="">By CTLT</div>
|
644 |
+
|
645 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=tabs-shortcode'; ?>">Import data</a></p>
|
646 |
+
</div>
|
647 |
+
|
648 |
+
|
649 |
+
|
650 |
+
<div class="item">
|
651 |
+
<img src="https://i.imgur.com/LEUcSIV.png">
|
652 |
+
<div class="">Wonder Tabs Trial</div>
|
653 |
+
<div class="">By Magic Hills Pty Ltd</div>
|
654 |
+
|
655 |
+
<p class=""><a class="button button-primary" href="<?php echo $actionurl.'&source=wonderplugin-tabs-trial'; ?>">Import data</a></p>
|
656 |
+
</div>
|
657 |
+
|
658 |
+
|
659 |
+
|
660 |
+
|
661 |
+
|
662 |
+
|
663 |
+
</div>
|
664 |
+
|
665 |
<!-- <p class="">Arconix FAQ - <a class="button button-primary" href="--><?php //echo $actionurl.'&source=arconix-faq'; ?><!--">Import data</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>-->
|
|
|
|
|
|
|
|
|
666 |
<!-- <p class="">Tabs By Biplob Adhikari - <a class="button button-primary" href="--><?php //echo $actionurl.'&source=vc-tabs'; ?><!--">Import data</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>-->
|
667 |
|
668 |
|
669 |
|
670 |
+
<style type="text/css">
|
671 |
+
.import-source{}
|
672 |
+
.import-source .item{
|
673 |
+
width: 255px;
|
674 |
+
overflow: hidden;
|
675 |
+
display: inline-block;
|
676 |
+
margin: 10px;
|
677 |
+
background: #306c9e;
|
678 |
+
padding: 10px;
|
679 |
+
color: #fff;
|
680 |
+
}
|
681 |
+
.import-source .item img{
|
682 |
+
width: 100%;
|
683 |
+
}
|
684 |
+
|
685 |
+
|
686 |
+
</style>
|
687 |
+
|
688 |
<?php
|
689 |
|
690 |
$html = ob_get_clean();
|
693 |
'id' => 'reset_migrate',
|
694 |
//'parent' => '',
|
695 |
'title' => __('Import data','accordions'),
|
696 |
+
'details' => __('Please contact our support form to add new 3rd party plugin source.','accordions'),
|
697 |
'type' => 'custom_html',
|
698 |
'html' => $html,
|
699 |
|
includes/functions.php
CHANGED
@@ -1,6 +1,123 @@
|
|
1 |
<?php
|
2 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
add_filter('the_content','accordions_preview_content');
|
5 |
function accordions_preview_content($content){
|
6 |
if(is_singular('accordions')){
|
1 |
<?php
|
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 |
+
|
8 |
+
|
9 |
+
if(strpos($content, '[restabs')){
|
10 |
+
$tabs = accordions_str_between_all($content, "[restabs", "[/restabs]");
|
11 |
+
|
12 |
+
foreach ($tabs as $tab_content){
|
13 |
+
|
14 |
+
$shortcode_content = accordions_nested_shortcode_content($tab_content, $child_tag='restab');
|
15 |
+
echo '<pre>'.var_export('#####', true).'</pre>';
|
16 |
+
echo '<pre>'.var_export($shortcode_content, true).'</pre>';
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
return $content;
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
function accordions_str_between_all($string, $start, $end, $includeDelimiters = false, &$offset = 0){
|
27 |
+
$strings = [];
|
28 |
+
$length = strlen($string);
|
29 |
+
|
30 |
+
while ($offset < $length)
|
31 |
+
{
|
32 |
+
$found = accordions_str_between($string, $start, $end, $includeDelimiters, $offset);
|
33 |
+
if ($found === null) break;
|
34 |
+
|
35 |
+
$strings[] = $found;
|
36 |
+
$offset += strlen($includeDelimiters ? $found : $start . $found . $end); // move offset to the end of the newfound string
|
37 |
+
}
|
38 |
+
|
39 |
+
return $strings;
|
40 |
+
}
|
41 |
+
|
42 |
+
function accordions_str_between($string, $start, $end, $includeDelimiters = false, &$offset = 0){
|
43 |
+
if ($string === '' || $start === '' || $end === '') return null;
|
44 |
+
|
45 |
+
$startLength = strlen($start);
|
46 |
+
$endLength = strlen($end);
|
47 |
+
|
48 |
+
$startPos = strpos($string, $start, $offset);
|
49 |
+
if ($startPos === false) return null;
|
50 |
+
|
51 |
+
$endPos = strpos($string, $end, $startPos + $startLength);
|
52 |
+
if ($endPos === false) return null;
|
53 |
+
|
54 |
+
$length = $endPos - $startPos + ($includeDelimiters ? $endLength : -$startLength);
|
55 |
+
if (!$length) return '';
|
56 |
+
|
57 |
+
$offset = $startPos + ($includeDelimiters ? 0 : $startLength);
|
58 |
+
|
59 |
+
$result = substr($string, $offset, $length);
|
60 |
+
|
61 |
+
return ($result !== false ? $result : null);
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
function accordions_nested_shortcode_content($string, $child_tag='restab'){
|
73 |
+
|
74 |
+
$accordion_content = array();
|
75 |
+
|
76 |
+
//echo '<pre>'.var_export($tabs, true).'</pre>';
|
77 |
+
|
78 |
+
|
79 |
+
$tabs = explode('['.$child_tag, $string);
|
80 |
+
unset($tabs[0]);
|
81 |
+
|
82 |
+
$i = 0;
|
83 |
+
foreach ($tabs as $tab){
|
84 |
+
$tab = str_replace('[/'.$child_tag.']','', $tab);
|
85 |
+
$tab = str_replace(' active="active"','', $tab);
|
86 |
+
|
87 |
+
$title_content = explode(']', $tab);
|
88 |
+
$title = isset($title_content[0]) ? $title_content[0] : '';
|
89 |
+
|
90 |
+
preg_match('/title="(.*?)"/', $title, $output_array);
|
91 |
+
|
92 |
+
$title = $output_array[1];
|
93 |
+
|
94 |
+
//$title = str_replace('title="','', $title);
|
95 |
+
//$title = str_replace('"','', $title);
|
96 |
+
$acc_title = ltrim($title);
|
97 |
+
|
98 |
+
$acc_content = isset($title_content[1]) ? $title_content[1] : '';
|
99 |
+
|
100 |
+
$accordion_content[$i]['title'] = $acc_title;
|
101 |
+
$accordion_content[$i]['content'] = $acc_content;
|
102 |
+
|
103 |
+
$i++;
|
104 |
+
}
|
105 |
+
|
106 |
+
//echo '<pre>'.var_export($accordion_content, true).'</pre>';
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
return $accordion_content;
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
add_filter('the_content','accordions_preview_content');
|
122 |
function accordions_preview_content($content){
|
123 |
if(is_singular('accordions')){
|
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.3
|
7 |
-
Stable tag: 2.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -60,6 +60,10 @@ You can create accordion content with WP Editor, you can add text, image andothe
|
|
60 |
video and etc. Section can be drag & drop sorting. delete any section without
|
61 |
loading the page and can hide without deleting it on front-end.
|
62 |
|
|
|
|
|
|
|
|
|
63 |
###Premium Features
|
64 |
|
65 |
**Nested/multi level accordion**
|
@@ -135,6 +139,9 @@ then paste this shortcode anywhere in your page to display accordions<br />
|
|
135 |
|
136 |
== Changelog ==
|
137 |
|
|
|
|
|
|
|
138 |
= 2.2.4 =
|
139 |
* 16-03-2020 - fix - font awesome version compatibility issue fixed.
|
140 |
* 16-03-2020 - add - 3rd party accordion and tabs data import.
|
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.3
|
7 |
+
Stable tag: 2.2.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
60 |
video and etc. Section can be drag & drop sorting. delete any section without
|
61 |
loading the page and can hide without deleting it on front-end.
|
62 |
|
63 |
+
**Import 3rd party plugin data**
|
64 |
+
You can import accordion and tabs data from 3rd party plugin source.
|
65 |
+
|
66 |
+
|
67 |
###Premium Features
|
68 |
|
69 |
**Nested/multi level accordion**
|
139 |
|
140 |
== Changelog ==
|
141 |
|
142 |
+
= 2.2.5 =
|
143 |
+
* 2020-03-17 - add - 20 3rd party plugin to import accordion and tabs data.
|
144 |
+
|
145 |
= 2.2.4 =
|
146 |
* 16-03-2020 - fix - font awesome version compatibility issue fixed.
|
147 |
* 16-03-2020 - add - 3rd party accordion and tabs data import.
|
templates/accordion/accordion-hook.php
CHANGED
@@ -514,9 +514,9 @@ function accordions_main_scripts($atts){
|
|
514 |
|
515 |
$accordions_options = get_post_meta($post_id,'accordions_options', true);
|
516 |
$accordion = isset($accordions_options['accordion']) ? $accordions_options['accordion'] : array();
|
517 |
-
$collapsible =
|
518 |
$height_style = isset($accordion['height_style']) ? $accordion['height_style'] : 'content';
|
519 |
-
$active_event =
|
520 |
|
521 |
$animate_style = !empty($accordion['animate_style']) ? $accordion['animate_style'] : 'swing';
|
522 |
$animate_delay = !empty($accordion['animate_delay']) ? $accordion['animate_delay'] : 1000;
|
514 |
|
515 |
$accordions_options = get_post_meta($post_id,'accordions_options', true);
|
516 |
$accordion = isset($accordions_options['accordion']) ? $accordions_options['accordion'] : array();
|
517 |
+
$collapsible = !empty($accordion['collapsible']) ? $accordion['collapsible'] : 'true';
|
518 |
$height_style = isset($accordion['height_style']) ? $accordion['height_style'] : 'content';
|
519 |
+
$active_event = !empty($accordion['active_event']) ? $accordion['active_event'] : 'click';
|
520 |
|
521 |
$animate_style = !empty($accordion['animate_style']) ? $accordion['animate_style'] : 'swing';
|
522 |
$animate_delay = !empty($accordion['animate_delay']) ? $accordion['animate_delay'] : 1000;
|
templates/tabs/tabs-hook.php
CHANGED
@@ -533,7 +533,7 @@ function accordions_tabs_main_scripts($atts){
|
|
533 |
|
534 |
|
535 |
$tabs = isset($accordions_options['tabs']) ? $accordions_options['tabs'] : array();
|
536 |
-
$collapsible =
|
537 |
$active_event = isset($tabs['active_event']) ? $tabs['active_event'] : 'click';
|
538 |
$tabs_is_vertical = isset($tabs['is_vertical']) ? $tabs['is_vertical'] : '';
|
539 |
?>
|
533 |
|
534 |
|
535 |
$tabs = isset($accordions_options['tabs']) ? $accordions_options['tabs'] : array();
|
536 |
+
$collapsible = !empty($tabs['collapsible']) ? $tabs['collapsible'] : 'true';
|
537 |
$active_event = isset($tabs['active_event']) ? $tabs['active_event'] : 'click';
|
538 |
$tabs_is_vertical = isset($tabs['is_vertical']) ? $tabs['is_vertical'] : '';
|
539 |
?>
|