Version Description
- 2022-04-30 - fix - jQuery issue fixed.
Download this release
Release Info
Developer | pickplugins |
Plugin | Accordion |
Version | 2.2.38 |
Comparing to | |
See all releases |
Code changes from version 2.2.37 to 2.2.38
- accordions.php +2 -2
- assets/admin/js/scripts.js +8 -2
- assets/frontend/js/scripts.js +0 -3
- assets/settings-tabs/settings-tabs.js +17 -12
- includes/class-post-meta-accordions-hook.php +5 -2
- includes/class-post-meta-accordions.php +5 -3
- includes/class-post-meta-product.php +6 -3
- includes/class-settings-hook.php +4 -2
- includes/class-settings-tabs.php +23 -8
- readme.txt +4 -1
- templates/accordion/accordion-hook.php +18 -10
- templates/tabs/tabs-hook.php +232 -244
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 |
Author: PickPlugins
|
8 |
Author URI: http://pickplugins.com
|
9 |
Text Domain: accordions
|
@@ -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 |
|
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.38
|
7 |
Author: PickPlugins
|
8 |
Author URI: http://pickplugins.com
|
9 |
Text Domain: 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.38');
|
27 |
define('accordions_plugin_name', 'Accordions');
|
28 |
define('accordions_plugin_basename', plugin_basename(__FILE__));
|
29 |
|
assets/admin/js/scripts.js
CHANGED
@@ -1,7 +1,12 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
2 |
$(document).on('click','.accordions-import-json',function(){
|
3 |
json_file = $('.json_file').val();
|
4 |
|
|
|
5 |
|
6 |
|
7 |
if(json_file){
|
@@ -27,4 +32,5 @@ jQuery(document).ready(function($) {
|
|
27 |
alert('Please put file url');
|
28 |
}
|
29 |
})
|
30 |
-
});
|
|
1 |
+
|
2 |
+
(function($) {
|
3 |
+
|
4 |
+
$(document).on("ready",function(){
|
5 |
+
|
6 |
$(document).on('click','.accordions-import-json',function(){
|
7 |
json_file = $('.json_file').val();
|
8 |
|
9 |
+
console.log('Hello');
|
10 |
|
11 |
|
12 |
if(json_file){
|
32 |
alert('Please put file url');
|
33 |
}
|
34 |
})
|
35 |
+
});
|
36 |
+
})(jQuery);
|
assets/frontend/js/scripts.js
CHANGED
@@ -1,3 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
|
3 |
-
});
|
|
|
|
|
|
assets/settings-tabs/settings-tabs.js
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
-
|
|
|
|
|
|
|
2 |
|
3 |
$( ".settings-tabs-loading").fadeOut();
|
4 |
$( ".settings-tabs").fadeIn();
|
@@ -154,7 +157,7 @@ jQuery(document).ready(function($){
|
|
154 |
|
155 |
})
|
156 |
|
157 |
-
|
158 |
|
159 |
dataName = $(this).attr('data-name');
|
160 |
dataSort = $(this).attr('data-sort');
|
@@ -175,11 +178,11 @@ jQuery(document).ready(function($){
|
|
175 |
|
176 |
|
177 |
|
178 |
-
html += ' <span class="button remove" onclick="
|
179 |
html += '</div>';
|
180 |
|
181 |
|
182 |
-
|
183 |
|
184 |
|
185 |
|
@@ -187,17 +190,17 @@ jQuery(document).ready(function($){
|
|
187 |
|
188 |
|
189 |
|
190 |
-
|
191 |
-
if(
|
192 |
-
|
193 |
}else{
|
194 |
-
|
195 |
textarea_to_editor();
|
196 |
}
|
197 |
})
|
198 |
|
199 |
-
|
200 |
-
now =
|
201 |
add_html = $(this).attr('add_html');
|
202 |
|
203 |
repeatable_html = add_html.replace(/TIMEINDEX/g, now);
|
@@ -274,7 +277,7 @@ jQuery(document).ready(function($){
|
|
274 |
|
275 |
|
276 |
|
277 |
-
|
278 |
|
279 |
$(this).prev('select').val('');
|
280 |
|
@@ -303,4 +306,6 @@ jQuery(document).ready(function($){
|
|
303 |
|
304 |
|
305 |
|
306 |
-
});
|
|
|
|
1 |
+
|
2 |
+
(function($) {
|
3 |
+
|
4 |
+
$(document).on("ready",function(){
|
5 |
|
6 |
$( ".settings-tabs-loading").fadeOut();
|
7 |
$( ".settings-tabs").fadeIn();
|
157 |
|
158 |
})
|
159 |
|
160 |
+
$(document).on('click', '.settings-tabs .input-text-multi-wrapper .add-item',function(){
|
161 |
|
162 |
dataName = $(this).attr('data-name');
|
163 |
dataSort = $(this).attr('data-sort');
|
178 |
|
179 |
|
180 |
|
181 |
+
html += ' <span class="button remove" onclick="$(this).parent().remove()"><i class="fas fa-times"></i></span>';
|
182 |
html += '</div>';
|
183 |
|
184 |
|
185 |
+
$(this).parent().children('.field-list').append(html);
|
186 |
|
187 |
|
188 |
|
190 |
|
191 |
|
192 |
|
193 |
+
$(document).on("click", ".settings-tabs .field-repeatable-wrapper .collapsible .header .title-text", function() {
|
194 |
+
if($(this).parent().parent().hasClass("active")){
|
195 |
+
$(this).parent().parent().removeClass("active");
|
196 |
}else{
|
197 |
+
$(this).parent().parent().addClass("active");
|
198 |
textarea_to_editor();
|
199 |
}
|
200 |
})
|
201 |
|
202 |
+
$(document).on("click", ".settings-tabs .field-repeatable-wrapper .add-repeat-field", function() {
|
203 |
+
now = $.now();
|
204 |
add_html = $(this).attr('add_html');
|
205 |
|
206 |
repeatable_html = add_html.replace(/TIMEINDEX/g, now);
|
277 |
|
278 |
|
279 |
|
280 |
+
$(document).on("click", ".settings-tabs .select-reset", function() {
|
281 |
|
282 |
$(this).prev('select').val('');
|
283 |
|
306 |
|
307 |
|
308 |
|
309 |
+
});
|
310 |
+
|
311 |
+
})(jQuery);
|
includes/class-post-meta-accordions-hook.php
CHANGED
@@ -108,7 +108,10 @@ function accordions_metabox_content_shortcode($post_id){
|
|
108 |
</style>
|
109 |
|
110 |
<script>
|
111 |
-
|
|
|
|
|
|
|
112 |
|
113 |
|
114 |
$(document).on('click', '.copy-to-clipboard input, .copy-to-clipboard textarea', function () {
|
@@ -121,7 +124,7 @@ function accordions_metabox_content_shortcode($post_id){
|
|
121 |
})
|
122 |
|
123 |
})
|
124 |
-
|
125 |
|
126 |
</script>
|
127 |
|
108 |
</style>
|
109 |
|
110 |
<script>
|
111 |
+
(function($) {
|
112 |
+
|
113 |
+
$(document).on("ready",function(){
|
114 |
+
|
115 |
|
116 |
|
117 |
$(document).on('click', '.copy-to-clipboard input, .copy-to-clipboard textarea', function () {
|
124 |
})
|
125 |
|
126 |
})
|
127 |
+
})(jQuery);
|
128 |
|
129 |
</script>
|
130 |
|
includes/class-post-meta-accordions.php
CHANGED
@@ -131,7 +131,9 @@ class class_accordions_post_meta{
|
|
131 |
?>
|
132 |
|
133 |
<script>
|
134 |
-
|
|
|
|
|
135 |
$(document).on('click', '.settings-tabs input[name="accordions_options[view_type]"]', function(){
|
136 |
var val = $(this).val();
|
137 |
|
@@ -150,7 +152,7 @@ class class_accordions_post_meta{
|
|
150 |
$( this ).show();
|
151 |
}
|
152 |
}else{
|
153 |
-
console.log('Not matched: '+ data_visible );
|
154 |
|
155 |
|
156 |
}
|
@@ -159,7 +161,7 @@ class class_accordions_post_meta{
|
|
159 |
|
160 |
})
|
161 |
})
|
162 |
-
|
163 |
|
164 |
</script>
|
165 |
|
131 |
?>
|
132 |
|
133 |
<script>
|
134 |
+
(function($) {
|
135 |
+
|
136 |
+
$(document).on("ready",function(){
|
137 |
$(document).on('click', '.settings-tabs input[name="accordions_options[view_type]"]', function(){
|
138 |
var val = $(this).val();
|
139 |
|
152 |
$( this ).show();
|
153 |
}
|
154 |
}else{
|
155 |
+
//console.log('Not matched: '+ data_visible );
|
156 |
|
157 |
|
158 |
}
|
161 |
|
162 |
})
|
163 |
})
|
164 |
+
})(jQuery);
|
165 |
|
166 |
</script>
|
167 |
|
includes/class-post-meta-product.php
CHANGED
@@ -54,12 +54,15 @@ class class_accordions_post_meta_product{
|
|
54 |
|
55 |
|
56 |
<script>
|
57 |
-
|
|
|
|
|
|
|
58 |
$(document).on('click', ".clear-faq-tab", function() {
|
59 |
$('#accordions_id').select2('destroy').val('').select2();
|
60 |
})
|
61 |
|
62 |
-
console.log(accordions_ajax.nonce);
|
63 |
|
64 |
$('#accordions_id').select2({
|
65 |
ajax: {
|
@@ -93,7 +96,7 @@ class class_accordions_post_meta_product{
|
|
93 |
allowClear: true,
|
94 |
});
|
95 |
})
|
96 |
-
|
97 |
</script>
|
98 |
|
99 |
<?php
|
54 |
|
55 |
|
56 |
<script>
|
57 |
+
|
58 |
+
(function($) {
|
59 |
+
|
60 |
+
$(document).on("ready",function(){
|
61 |
$(document).on('click', ".clear-faq-tab", function() {
|
62 |
$('#accordions_id').select2('destroy').val('').select2();
|
63 |
})
|
64 |
|
65 |
+
//console.log(accordions_ajax.nonce);
|
66 |
|
67 |
$('#accordions_id').select2({
|
68 |
ajax: {
|
96 |
allowClear: true,
|
97 |
});
|
98 |
})
|
99 |
+
})(jQuery);
|
100 |
</script>
|
101 |
|
102 |
<?php
|
includes/class-settings-hook.php
CHANGED
@@ -317,7 +317,9 @@ if(!function_exists('accordions_settings_content_help_support')) {
|
|
317 |
<p class="reset-migration"><a class="button button-primary" href="<?php echo esc_url_raw($actionurl); ?>">Reset migration</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>
|
318 |
|
319 |
<script>
|
320 |
-
|
|
|
|
|
321 |
$(document).on('click','.reset-migration a',function(event){
|
322 |
|
323 |
event.preventDefault();
|
@@ -335,7 +337,7 @@ if(!function_exists('accordions_settings_content_help_support')) {
|
|
335 |
$('.reset-migration span').fadeIn();
|
336 |
|
337 |
})
|
338 |
-
})
|
339 |
</script>
|
340 |
|
341 |
<?php
|
317 |
<p class="reset-migration"><a class="button button-primary" href="<?php echo esc_url_raw($actionurl); ?>">Reset migration</a> <span style="display: none; color: #f2433f; margin: 0 5px"> Click again to confirm!</span></p>
|
318 |
|
319 |
<script>
|
320 |
+
(function($) {
|
321 |
+
|
322 |
+
$(document).on("ready",function(){
|
323 |
$(document).on('click','.reset-migration a',function(event){
|
324 |
|
325 |
event.preventDefault();
|
337 |
$('.reset-migration span').fadeIn();
|
338 |
|
339 |
})
|
340 |
+
})})(jQuery);
|
341 |
</script>
|
342 |
|
343 |
<?php
|
includes/class-settings-tabs.php
CHANGED
@@ -1180,7 +1180,10 @@ class settings_tabs_field{
|
|
1180 |
}
|
1181 |
</style>
|
1182 |
<script>
|
1183 |
-
|
|
|
|
|
|
|
1184 |
$(document).on("keyup", ".text-icon input", function () {
|
1185 |
val = $(this).val();
|
1186 |
if(val){
|
@@ -1188,6 +1191,7 @@ class settings_tabs_field{
|
|
1188 |
}
|
1189 |
})
|
1190 |
})
|
|
|
1191 |
</script>
|
1192 |
<?php
|
1193 |
|
@@ -1232,14 +1236,16 @@ class settings_tabs_field{
|
|
1232 |
</div>
|
1233 |
|
1234 |
<script>
|
1235 |
-
|
|
|
|
|
1236 |
$(document).on("change", "#<?php echo $css_id; ?>", function () {
|
1237 |
val = $(this).val();
|
1238 |
if(val){
|
1239 |
$(this).parent().children(".range-value").html(val);
|
1240 |
}
|
1241 |
})
|
1242 |
-
})
|
1243 |
</script>
|
1244 |
|
1245 |
<style type="text/css">
|
@@ -1362,9 +1368,12 @@ class settings_tabs_field{
|
|
1362 |
<textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
|
1363 |
|
1364 |
<script>
|
1365 |
-
|
|
|
|
|
1366 |
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
1367 |
})
|
|
|
1368 |
</script>
|
1369 |
<?php
|
1370 |
|
@@ -1410,13 +1419,15 @@ class settings_tabs_field{
|
|
1410 |
<script>
|
1411 |
|
1412 |
|
1413 |
-
|
|
|
|
|
1414 |
|
1415 |
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
1416 |
|
1417 |
|
1418 |
})
|
1419 |
-
|
1420 |
|
1421 |
|
1422 |
|
@@ -1708,7 +1719,9 @@ class settings_tabs_field{
|
|
1708 |
ob_start();
|
1709 |
?>
|
1710 |
<input type="text" autocomplete="off" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
|
1711 |
-
<script>
|
|
|
|
|
1712 |
<?php
|
1713 |
|
1714 |
$input_html = ob_get_clean();
|
@@ -1787,7 +1800,9 @@ class settings_tabs_field{
|
|
1787 |
<div class="">
|
1788 |
<span><?php echo $arg_key; ?></span>
|
1789 |
<input name="<?php echo esc_attr($field_name); ?>[<?php echo esc_attr($arg_key); ?>]" id="<?php echo esc_attr($arg_key).'-'.esc_attr($css_id); ?>" value="<?php echo esc_attr($item_value); ?>" />
|
1790 |
-
<script>
|
|
|
|
|
1791 |
</div>
|
1792 |
|
1793 |
<?php
|
1180 |
}
|
1181 |
</style>
|
1182 |
<script>
|
1183 |
+
(function($) {
|
1184 |
+
|
1185 |
+
$(document).on("ready",function(){
|
1186 |
+
|
1187 |
$(document).on("keyup", ".text-icon input", function () {
|
1188 |
val = $(this).val();
|
1189 |
if(val){
|
1191 |
}
|
1192 |
})
|
1193 |
})
|
1194 |
+
})(jQuery);
|
1195 |
</script>
|
1196 |
<?php
|
1197 |
|
1236 |
</div>
|
1237 |
|
1238 |
<script>
|
1239 |
+
(function($) {
|
1240 |
+
|
1241 |
+
$(document).on("ready",function(){
|
1242 |
$(document).on("change", "#<?php echo $css_id; ?>", function () {
|
1243 |
val = $(this).val();
|
1244 |
if(val){
|
1245 |
$(this).parent().children(".range-value").html(val);
|
1246 |
}
|
1247 |
})
|
1248 |
+
})})(jQuery);
|
1249 |
</script>
|
1250 |
|
1251 |
<style type="text/css">
|
1368 |
<textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
|
1369 |
|
1370 |
<script>
|
1371 |
+
(function($) {
|
1372 |
+
|
1373 |
+
$(document).on("ready",function(){
|
1374 |
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
1375 |
})
|
1376 |
+
})(jQuery);
|
1377 |
</script>
|
1378 |
<?php
|
1379 |
|
1419 |
<script>
|
1420 |
|
1421 |
|
1422 |
+
(function($) {
|
1423 |
+
|
1424 |
+
$(document).on("ready",function(){
|
1425 |
|
1426 |
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
1427 |
|
1428 |
|
1429 |
})
|
1430 |
+
})(jQuery);
|
1431 |
|
1432 |
|
1433 |
|
1719 |
ob_start();
|
1720 |
?>
|
1721 |
<input type="text" autocomplete="off" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
|
1722 |
+
<script>(function($) {
|
1723 |
+
|
1724 |
+
$(document).on("ready",function(){$("#<?php echo $css_id; ?>").datepicker({ dateFormat: "<?php echo $format; ?>" });});})(jQuery);</script>
|
1725 |
<?php
|
1726 |
|
1727 |
$input_html = ob_get_clean();
|
1800 |
<div class="">
|
1801 |
<span><?php echo $arg_key; ?></span>
|
1802 |
<input name="<?php echo esc_attr($field_name); ?>[<?php echo esc_attr($arg_key); ?>]" id="<?php echo esc_attr($arg_key).'-'.esc_attr($css_id); ?>" value="<?php echo esc_attr($item_value); ?>" />
|
1803 |
+
<script>(function($) {
|
1804 |
+
|
1805 |
+
$(document).on("ready",function(){ $("#<?php echo $arg_key.'-'.$css_id; ?>").wpColorPicker();});})(jQuery);</script>
|
1806 |
</div>
|
1807 |
|
1808 |
<?php
|
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.9
|
7 |
-
Stable tag: 2.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -140,6 +140,9 @@ then paste this shortcode anywhere in your page to display accordions<br />
|
|
140 |
== Changelog ==
|
141 |
|
142 |
|
|
|
|
|
|
|
143 |
= 2.2.37 =
|
144 |
* 2022-01-08 - fix - Style issue fixed
|
145 |
|
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.9
|
7 |
+
Stable tag: 2.2.38
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
140 |
== Changelog ==
|
141 |
|
142 |
|
143 |
+
= 2.2.38 =
|
144 |
+
* 2022-04-30 - fix - jQuery issue fixed.
|
145 |
+
|
146 |
= 2.2.37 =
|
147 |
* 2022-01-08 - fix - Style issue fixed
|
148 |
|
templates/accordion/accordion-hook.php
CHANGED
@@ -21,10 +21,12 @@ function accordions_main_top($atts)
|
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<script>
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
28 |
</script><?php
|
29 |
endif;
|
30 |
}
|
@@ -379,7 +381,9 @@ function accordions_main_top($atts)
|
|
379 |
?>
|
380 |
</div>
|
381 |
<script>
|
382 |
-
|
|
|
|
|
383 |
<?php
|
384 |
if (isset($_GET['active_index'])) :
|
385 |
$accordion_index = isset($_GET['active_index']) ? esc_attr($_GET['active_index']) : '';
|
@@ -404,7 +408,7 @@ function accordions_main_top($atts)
|
|
404 |
<?php
|
405 |
endif;
|
406 |
?>
|
407 |
-
})
|
408 |
</script><?php
|
409 |
|
410 |
|
@@ -570,7 +574,9 @@ function accordions_main_top($atts)
|
|
570 |
|
571 |
?>
|
572 |
<script>
|
573 |
-
|
|
|
|
|
574 |
accordion_<?php echo esc_attr($post_id); ?> = $("#accordions-<?php echo esc_attr($post_id); ?> .items").accordion({
|
575 |
event: "<?php echo esc_attr($active_event); ?>",
|
576 |
collapsible: <?php echo esc_attr($collapsible); ?>,
|
@@ -604,16 +610,18 @@ function accordions_main_top($atts)
|
|
604 |
}
|
605 |
?>
|
606 |
});
|
607 |
-
})
|
608 |
</script>
|
609 |
<?php
|
610 |
|
611 |
if (!empty($custom_js)) :
|
612 |
?>
|
613 |
<script>
|
614 |
-
|
|
|
|
|
615 |
<?php echo ($custom_js); ?>
|
616 |
-
})
|
617 |
</script>
|
618 |
<?php
|
619 |
endif;
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<script>
|
24 |
+
(function($) {
|
25 |
+
$(window).on("load",function(){
|
26 |
+
$('#accordions-lazy-<?php echo esc_attr($post_id); ?>').fadeOut();
|
27 |
+
$('#accordions-<?php echo esc_attr($post_id); ?> .items').fadeIn();
|
28 |
+
})
|
29 |
+
})(jQuery);
|
30 |
</script><?php
|
31 |
endif;
|
32 |
}
|
381 |
?>
|
382 |
</div>
|
383 |
<script>
|
384 |
+
(function($) {
|
385 |
+
|
386 |
+
$(document).on("ready",function(){
|
387 |
<?php
|
388 |
if (isset($_GET['active_index'])) :
|
389 |
$accordion_index = isset($_GET['active_index']) ? esc_attr($_GET['active_index']) : '';
|
408 |
<?php
|
409 |
endif;
|
410 |
?>
|
411 |
+
})})(jQuery);
|
412 |
</script><?php
|
413 |
|
414 |
|
574 |
|
575 |
?>
|
576 |
<script>
|
577 |
+
(function($) {
|
578 |
+
|
579 |
+
$(document).on("ready",function(){
|
580 |
accordion_<?php echo esc_attr($post_id); ?> = $("#accordions-<?php echo esc_attr($post_id); ?> .items").accordion({
|
581 |
event: "<?php echo esc_attr($active_event); ?>",
|
582 |
collapsible: <?php echo esc_attr($collapsible); ?>,
|
610 |
}
|
611 |
?>
|
612 |
});
|
613 |
+
})})(jQuery);
|
614 |
</script>
|
615 |
<?php
|
616 |
|
617 |
if (!empty($custom_js)) :
|
618 |
?>
|
619 |
<script>
|
620 |
+
(function($) {
|
621 |
+
|
622 |
+
$(document).on("ready",function(){
|
623 |
<?php echo ($custom_js); ?>
|
624 |
+
})})(jQuery);
|
625 |
</script>
|
626 |
<?php
|
627 |
endif;
|
templates/tabs/tabs-hook.php
CHANGED
@@ -1,29 +1,30 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
|
4 |
//add_action('accordions_tabs_main', 'accordions_tabs_main_top');
|
5 |
|
6 |
-
function accordions_tabs_main_top($atts)
|
|
|
7 |
|
8 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
9 |
-
$accordions_options = get_post_meta($post_id,'accordions_options', true);
|
10 |
$accordions_options = !empty($accordions_options) ? $accordions_options : accordions_old_options($post_id);
|
11 |
|
12 |
|
13 |
$lazy_load = isset($accordions_options['lazy_load']) ? $accordions_options['lazy_load'] : 'yes';
|
14 |
$lazy_load_src = isset($accordions_options['lazy_load_src']) ? $accordions_options['lazy_load_src'] : '';
|
15 |
|
16 |
-
if($lazy_load=='yes'):
|
17 |
-
|
18 |
<div id="accordions-lazy-<?php echo esc_attr($post_id); ?>" class="accordions-lazy">
|
19 |
-
<?php if(!empty($lazy_load_src))
|
20 |
<img src="<?php echo esc_url_raw($lazy_load_src); ?>" />
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<script>
|
24 |
-
jQuery(window).load(function(){
|
25 |
-
|
26 |
-
|
27 |
});
|
28 |
</script>
|
29 |
<?php
|
@@ -38,11 +39,12 @@ function accordions_tabs_main_top($atts){
|
|
38 |
|
39 |
add_action('accordions_tabs_main', 'accordions_tabs_main_style');
|
40 |
|
41 |
-
function accordions_tabs_main_style($atts)
|
|
|
42 |
|
43 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
44 |
|
45 |
-
$accordions_options = get_post_meta($post_id,'accordions_options', true);
|
46 |
$accordions_options = !empty($accordions_options) ? $accordions_options : accordions_old_options($post_id);
|
47 |
|
48 |
|
@@ -114,16 +116,15 @@ function accordions_tabs_main_style($atts){
|
|
114 |
wp_enqueue_style('accordions-style');
|
115 |
wp_enqueue_style('jquery-ui');
|
116 |
|
117 |
-
if($font_aw_version =='v_5'){
|
118 |
wp_enqueue_style('fontawesome-5');
|
119 |
-
}elseif($font_aw_version =='v_4'){
|
120 |
wp_enqueue_style('fontawesome-4');
|
121 |
-
}else{
|
122 |
-
|
123 |
}
|
124 |
|
125 |
-
wp_enqueue_script(
|
126 |
-
wp_enqueue_script(
|
127 |
wp_enqueue_script('jquery-ui-tabs');
|
128 |
wp_enqueue_script('jquery-effects-core');
|
129 |
|
@@ -131,162 +132,141 @@ function accordions_tabs_main_style($atts){
|
|
131 |
|
132 |
?>
|
133 |
<style type='text/css'>
|
134 |
-
@media only screen and (min-width: 1024px
|
135 |
#accordions-tabs-<?php echo esc_attr($post_id); ?> {
|
136 |
-
|
137 |
-
|
138 |
-
<?php endif; ?>
|
139 |
}
|
140 |
}
|
141 |
-
|
|
|
142 |
#accordions-tabs-<?php echo esc_attr($post_id); ?> {
|
143 |
-
|
144 |
-
|
145 |
-
<?php endif; ?>
|
146 |
}
|
147 |
}
|
148 |
-
|
|
|
149 |
#accordions-tabs-<?php echo esc_attr($post_id); ?> {
|
150 |
-
|
151 |
-
|
152 |
-
<?php endif; ?>
|
153 |
}
|
154 |
}
|
155 |
-
|
156 |
-
|
157 |
-
text-align: <?php echo esc_attr($container_text_align); ?>;
|
158 |
-
|
159 |
-
}
|
160 |
-
#accordions-tabs-<?php echo esc_attr($post_id); ?>{
|
161 |
-
<?php if(!empty($container_background_color)):?>
|
162 |
-
background-color:<?php echo esc_attr($container_background_color); ?>;
|
163 |
-
<?php endif; ?>
|
164 |
-
<?php if(!empty($container_background_img)):?>
|
165 |
-
background-image: url(<?php echo esc_attr($container_background_img); ?>);
|
166 |
-
<?php endif; ?>
|
167 |
-
|
168 |
-
<?php if(!empty($container_padding)):?>
|
169 |
-
padding: <?php echo esc_attr($container_padding); ?>;
|
170 |
-
<?php endif; ?>
|
171 |
-
}
|
172 |
-
#accordions-tabs-<?php echo esc_attr($post_id); ?> .tabs-nav{
|
173 |
-
<?php if(!empty($header_background_color)):?>
|
174 |
-
background-color:<?php echo esc_attr($header_background_color); ?>;
|
175 |
-
<?php endif; ?>
|
176 |
-
<?php if(!empty($header_margin)):?>
|
177 |
-
margin:<?php echo esc_attr($header_margin); ?> !important;
|
178 |
-
<?php endif; ?>
|
179 |
-
<?php if(!empty($header_padding)):?>
|
180 |
-
padding:<?php echo esc_attr($header_padding); ?> !important;
|
181 |
-
<?php endif; ?>
|
182 |
-
<?php if(!empty($navs_alignment)):?>
|
183 |
-
float:<?php echo esc_attr($navs_alignment); ?> !important;
|
184 |
-
<?php endif; ?>
|
185 |
-
border: none;
|
186 |
}
|
187 |
-
|
188 |
-
|
189 |
-
background-color: <?php echo esc_attr($
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
}
|
194 |
-
|
195 |
-
|
196 |
-
color
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
margin:0px !important;
|
202 |
-
padding:0px !important;
|
203 |
}
|
204 |
-
|
205 |
-
|
206 |
-
color
|
207 |
-
|
|
|
208 |
}
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
}
|
216 |
-
|
217 |
-
|
218 |
-
color
|
219 |
-
|
220 |
-
<?php if(!empty($icon_font_size)):?>
|
221 |
-
font-size:<?php echo esc_attr($icon_font_size); ?>;
|
222 |
-
<?php endif; ?>
|
223 |
-
<?php if(!empty($icon_background_color)):?>
|
224 |
-
background:<?php echo esc_attr($icon_background_color); ?> none repeat scroll 0 0;
|
225 |
-
<?php endif; ?>
|
226 |
-
<?php if(!empty($icon_padding)):?>
|
227 |
-
padding:<?php echo esc_attr($icon_padding); ?>;
|
228 |
-
<?php endif; ?>
|
229 |
-
<?php if(!empty($icon_margin)):?>
|
230 |
-
margin:<?php echo esc_attr($icon_margin); ?>;
|
231 |
-
<?php endif; ?>
|
232 |
}
|
233 |
-
|
234 |
-
|
235 |
-
color
|
236 |
-
|
|
|
237 |
}
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
241 |
<?php endif; ?>
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
font-size:<?php echo esc_attr($body_font_size); ?>;
|
247 |
<?php endif; ?>
|
248 |
-
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
<?php endif; ?>
|
251 |
-
<?php if(!empty($body_padding)):?>
|
252 |
-
padding:<?php echo esc_attr($body_padding); ?>;
|
253 |
-
<?php endif; ?>
|
254 |
}
|
255 |
-
|
256 |
-
|
257 |
-
color
|
258 |
-
|
259 |
-
|
260 |
-
font-size:<?php echo esc_attr($icon_font_size); ?>;
|
261 |
-
<?php endif; ?>
|
262 |
}
|
|
|
263 |
<?php
|
264 |
-
if(!empty($accordions_custom_css)){
|
265 |
echo esc_attr($accordions_custom_css);
|
266 |
}
|
267 |
-
if($tabs_icon_toggle=='yes'){
|
268 |
-
|
269 |
-
.accordions-tabs .ui-tabs-active .accordions-tab-plus {
|
270 |
display: none;
|
271 |
}
|
|
|
272 |
.accordions-tabs .ui-tabs-active .accordions-tab-minus {
|
273 |
display: inline;
|
274 |
}
|
|
|
275 |
<?php
|
276 |
-
|
277 |
-
|
278 |
|
279 |
-
|
280 |
-
|
281 |
|
282 |
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
<?php
|
288 |
-
|
289 |
-
|
290 |
</style>
|
291 |
<?php
|
292 |
}
|
@@ -299,10 +279,11 @@ function accordions_tabs_main_style($atts){
|
|
299 |
|
300 |
add_action('accordions_tabs_main', 'accordions_tabs_main_items');
|
301 |
|
302 |
-
function accordions_tabs_main_items($atts)
|
|
|
303 |
|
304 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
305 |
-
$accordions_options = get_post_meta($post_id,'accordions_options', true);
|
306 |
$accordions_options = !empty($accordions_options) ? $accordions_options : accordions_old_options($post_id);
|
307 |
|
308 |
|
@@ -329,7 +310,7 @@ function accordions_tabs_main_items($atts){
|
|
329 |
|
330 |
|
331 |
|
332 |
-
if(empty($accordions_content)){
|
333 |
|
334 |
$accordions_content = accordions_old_content($post_id);
|
335 |
//var_dump($accordions_content);
|
@@ -340,67 +321,67 @@ function accordions_tabs_main_items($atts){
|
|
340 |
$nav_content_html = '';
|
341 |
$active_index = array();
|
342 |
|
343 |
-
|
344 |
|
345 |
-
|
346 |
|
347 |
-
|
348 |
|
349 |
-
|
350 |
|
351 |
-
|
352 |
|
353 |
|
354 |
-
|
355 |
-
|
356 |
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
|
362 |
|
363 |
-
|
364 |
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
|
369 |
|
370 |
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
}
|
376 |
}
|
|
|
377 |
|
378 |
|
379 |
|
380 |
-
|
381 |
|
382 |
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
|
396 |
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
|
405 |
<a style="" class="accordions-tab-head" href="#tabs-<?php echo $index; ?>">
|
406 |
<span id="accordion-icons-<?php echo $index; ?>" class="accordion-icons">
|
@@ -409,72 +390,74 @@ function accordions_tabs_main_items($atts){
|
|
409 |
</span>
|
410 |
<span id="header-text-<?php echo $index; ?>" class="accordions-head-title"><?php echo do_shortcode($accordion_header); ?></span>
|
411 |
</a>
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
|
427 |
|
428 |
-
|
429 |
|
430 |
-
|
431 |
-
|
432 |
|
433 |
-
|
434 |
-
|
435 |
|
436 |
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
|
441 |
-
|
442 |
-
|
443 |
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
|
448 |
-
|
449 |
-
|
450 |
|
451 |
-
|
452 |
|
453 |
<ul>
|
454 |
<?php echo $nav_html; ?>
|
455 |
</ul>
|
456 |
<?php echo $nav_content_html; ?>
|
457 |
<script>
|
458 |
-
|
|
|
|
|
459 |
<?php
|
460 |
-
if(isset($_GET['active_index'])):
|
461 |
$accordion_index = isset($_GET['active_index']) ? esc_attr($_GET['active_index']) : '';
|
462 |
$accordion_index = explode('-', $accordion_index);
|
463 |
-
foreach ($accordion_index as $args){
|
464 |
$args_arr = explode('|', $args);
|
465 |
$accordion_id = isset($args_arr[0]) ? $args_arr[0] : '';
|
466 |
$accordion_indexes = isset($args_arr[1]) ? $args_arr[1] : '';
|
467 |
-
|
468 |
accordions_tabs_active_index_<?php echo $accordion_id; ?> = <?php echo $accordion_indexes; ?>;
|
469 |
-
|
470 |
}
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
endif;
|
476 |
?>
|
477 |
-
})
|
478 |
</script>
|
479 |
<?php
|
480 |
|
@@ -483,7 +466,8 @@ function accordions_tabs_main_items($atts){
|
|
483 |
|
484 |
add_action('accordions_tabs_main', 'accordions_tabs_main_edit_link');
|
485 |
|
486 |
-
function accordions_tabs_main_edit_link($atts)
|
|
|
487 |
|
488 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
489 |
|
@@ -496,16 +480,15 @@ function accordions_tabs_main_edit_link($atts){
|
|
496 |
|
497 |
|
498 |
|
499 |
-
if(current_user_can('administrator') && $hide_edit == 'no'){
|
500 |
$admin_url = admin_url();
|
501 |
-
$accordion_edit_url = apply_filters('accordions_edit_url', ''
|
502 |
|
503 |
-
|
504 |
-
<div class="accordion-edit"><a href="<?php echo $accordion_edit_url; ?>"><?php echo __('Edit this accordion','accordions'); ?></a>, <?php echo __("Only admin can see this.",'accordions')?></div>
|
505 |
-
|
506 |
|
507 |
}
|
508 |
-
|
509 |
}
|
510 |
|
511 |
|
@@ -516,11 +499,12 @@ function accordions_tabs_main_edit_link($atts){
|
|
516 |
|
517 |
add_action('accordions_tabs_main', 'accordions_tabs_main_scripts');
|
518 |
|
519 |
-
function accordions_tabs_main_scripts($atts)
|
|
|
520 |
|
521 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
522 |
|
523 |
-
$accordions_options = get_post_meta($post_id,'accordions_options', true);
|
524 |
$accordions_options = !empty($accordions_options) ? $accordions_options : accordions_old_options($post_id);
|
525 |
|
526 |
$custom_scripts = isset($accordions_options['custom_scripts']) ? $accordions_options['custom_scripts'] : array();
|
@@ -534,32 +518,36 @@ function accordions_tabs_main_scripts($atts){
|
|
534 |
$tabs_is_vertical = isset($tabs['is_vertical']) ? $tabs['is_vertical'] : '';
|
535 |
?>
|
536 |
<script>
|
537 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
<?php
|
539 |
-
if($tabs_is_vertical=='yes'){
|
540 |
-
?>
|
541 |
-
$( "#accordions-tabs-<?php echo $post_id; ?>" ).addClass( "ui-tabs-vertical ui-helper-clearfix" );
|
542 |
-
$( "#accordions-tabs-<?php echo $post_id; ?> li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
|
543 |
-
<?php
|
544 |
}
|
545 |
?>
|
546 |
-
$("#accordions-tabs-<?php echo $post_id; ?>"
|
547 |
collapsible: <?php echo $collapsible; ?>,
|
548 |
event: "<?php echo $active_event; ?>",
|
549 |
active: <?php echo $active_tab; ?>,
|
550 |
});
|
551 |
-
if(typeof accordions_tabs_active_index_<?php echo $post_id; ?> != 'undefined'){
|
552 |
$("#accordions-tabs-<?php echo $post_id; ?>").tabs("option", "active", accordions_tabs_active_index_<?php echo $post_id; ?>);
|
553 |
}
|
554 |
-
})
|
555 |
</script>
|
556 |
<?php
|
557 |
-
if(!empty($custom_js)):
|
558 |
-
|
559 |
<script>
|
560 |
-
|
|
|
|
|
561 |
<?php echo $custom_js; ?>
|
562 |
-
})
|
563 |
</script>
|
564 |
<?php
|
565 |
endif;
|
@@ -567,11 +555,11 @@ function accordions_tabs_main_scripts($atts){
|
|
567 |
|
568 |
|
569 |
add_action('accordions_tabs_main_no_content', 'accordions_tabs_main_no_content');
|
570 |
-
function accordions_tabs_main_no_content()
|
|
|
571 |
|
572 |
?>
|
573 |
-
<p><?php echo __('Content missing',''); ?></p>
|
574 |
-
|
575 |
|
576 |
}
|
577 |
-
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH')) exit; // if direct access
|
3 |
|
4 |
//add_action('accordions_tabs_main', 'accordions_tabs_main_top');
|
5 |
|
6 |
+
function accordions_tabs_main_top($atts)
|
7 |
+
{
|
8 |
|
9 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
10 |
+
$accordions_options = get_post_meta($post_id, 'accordions_options', true);
|
11 |
$accordions_options = !empty($accordions_options) ? $accordions_options : accordions_old_options($post_id);
|
12 |
|
13 |
|
14 |
$lazy_load = isset($accordions_options['lazy_load']) ? $accordions_options['lazy_load'] : 'yes';
|
15 |
$lazy_load_src = isset($accordions_options['lazy_load_src']) ? $accordions_options['lazy_load_src'] : '';
|
16 |
|
17 |
+
if ($lazy_load == 'yes') :
|
18 |
+
?>
|
19 |
<div id="accordions-lazy-<?php echo esc_attr($post_id); ?>" class="accordions-lazy">
|
20 |
+
<?php if (!empty($lazy_load_src)) : ?>
|
21 |
<img src="<?php echo esc_url_raw($lazy_load_src); ?>" />
|
22 |
<?php endif; ?>
|
23 |
</div>
|
24 |
<script>
|
25 |
+
jQuery(window).load(function($) {
|
26 |
+
$('#accordions-lazy-<?php echo esc_attr($post_id); ?>').fadeOut();
|
27 |
+
$('#accordions-<?php echo esc_attr($post_id); ?> .items').fadeIn();
|
28 |
});
|
29 |
</script>
|
30 |
<?php
|
39 |
|
40 |
add_action('accordions_tabs_main', 'accordions_tabs_main_style');
|
41 |
|
42 |
+
function accordions_tabs_main_style($atts)
|
43 |
+
{
|
44 |
|
45 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
46 |
|
47 |
+
$accordions_options = get_post_meta($post_id, 'accordions_options', true);
|
48 |
$accordions_options = !empty($accordions_options) ? $accordions_options : accordions_old_options($post_id);
|
49 |
|
50 |
|
116 |
wp_enqueue_style('accordions-style');
|
117 |
wp_enqueue_style('jquery-ui');
|
118 |
|
119 |
+
if ($font_aw_version == 'v_5') {
|
120 |
wp_enqueue_style('fontawesome-5');
|
121 |
+
} elseif ($font_aw_version == 'v_4') {
|
122 |
wp_enqueue_style('fontawesome-4');
|
123 |
+
} else {
|
|
|
124 |
}
|
125 |
|
126 |
+
wp_enqueue_script('jquery');
|
127 |
+
wp_enqueue_script('jquery-ui-core');
|
128 |
wp_enqueue_script('jquery-ui-tabs');
|
129 |
wp_enqueue_script('jquery-effects-core');
|
130 |
|
132 |
|
133 |
?>
|
134 |
<style type='text/css'>
|
135 |
+
@media only screen and (min-width: 1024px) {
|
136 |
#accordions-tabs-<?php echo esc_attr($post_id); ?> {
|
137 |
+
<?php if (!empty($width_large)) : ?>width: <?php echo esc_attr($width_large); ?>;
|
138 |
+
<?php endif; ?>
|
|
|
139 |
}
|
140 |
}
|
141 |
+
|
142 |
+
@media only screen and (min-width: 768px) and (max-width: 1023px) {
|
143 |
#accordions-tabs-<?php echo esc_attr($post_id); ?> {
|
144 |
+
<?php if (!empty($width_medium)) : ?>width: <?php echo esc_attr($width_medium); ?>;
|
145 |
+
<?php endif; ?>
|
|
|
146 |
}
|
147 |
}
|
148 |
+
|
149 |
+
@media only screen and (min-width: 0px) and (max-width: 767px) {
|
150 |
#accordions-tabs-<?php echo esc_attr($post_id); ?> {
|
151 |
+
<?php if (!empty($width_small)) : ?>width: <?php echo esc_attr($width_small); ?>;
|
152 |
+
<?php endif; ?>
|
|
|
153 |
}
|
154 |
}
|
155 |
+
|
156 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?> {
|
157 |
+
<?php if (!empty($container_text_align)) : ?>text-align: <?php echo esc_attr($container_text_align); ?>;
|
158 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
}
|
160 |
+
|
161 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?> {
|
162 |
+
<?php if (!empty($container_background_color)) : ?>background-color: <?php echo esc_attr($container_background_color); ?>;
|
163 |
+
<?php endif; ?><?php if (!empty($container_background_img)) : ?>background-image: url(<?php echo esc_attr($container_background_img); ?>);
|
164 |
+
<?php endif; ?><?php if (!empty($container_padding)) : ?>padding: <?php echo esc_attr($container_padding); ?>;
|
165 |
+
<?php endif; ?>
|
166 |
}
|
167 |
+
|
168 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.tabs-nav {
|
169 |
+
<?php if (!empty($header_background_color)) : ?>background-color: <?php echo esc_attr($header_background_color); ?>;
|
170 |
+
<?php endif; ?><?php if (!empty($header_margin)) : ?>margin: <?php echo esc_attr($header_margin); ?> !important;
|
171 |
+
<?php endif; ?><?php if (!empty($header_padding)) : ?>padding: <?php echo esc_attr($header_padding); ?> !important;
|
172 |
+
<?php endif; ?><?php if (!empty($navs_alignment)) : ?>float: <?php echo esc_attr($navs_alignment); ?> !important;
|
173 |
+
<?php endif; ?>border: none;
|
|
|
|
|
174 |
}
|
175 |
+
|
176 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.tabs-nav:hover {
|
177 |
+
<?php if (!empty($header_active_background_color)) : ?>background-color: <?php echo esc_attr($header_active_background_color); ?>;
|
178 |
+
<?php else : ?>background-color: rgba(0, 0, 0, 0);
|
179 |
+
<?php endif; ?>
|
180 |
}
|
181 |
+
|
182 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.ui-tabs-anchor {
|
183 |
+
<?php if (!empty($header_color)) : ?>color: <?php echo esc_attr($header_color); ?>;
|
184 |
+
<?php endif; ?><?php if (!empty($header_font_size)) : ?>font-size: <?php echo esc_attr($header_font_size); ?>;
|
185 |
+
<?php endif; ?>margin: 0px !important;
|
186 |
+
padding: 0px !important;
|
187 |
}
|
188 |
+
|
189 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.accordions-head-title {
|
190 |
+
<?php if (!empty($header_color)) : ?>color: <?php echo esc_attr($header_color); ?>;
|
191 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
+
|
194 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.ui-tabs-active {
|
195 |
+
<?php if (!empty($header_active_background_color)) : ?>background-color: <?php echo esc_attr($header_active_background_color); ?>;
|
196 |
+
<?php else : ?>background-color: rgba(0, 0, 0, 0);
|
197 |
+
<?php endif; ?>
|
198 |
}
|
199 |
+
|
200 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.accordion-icons {
|
201 |
+
<?php if (!empty($icon_color)) : ?>color: <?php echo esc_attr($icon_color); ?>;
|
202 |
+
<?php endif; ?><?php if (!empty($icon_font_size)) : ?>font-size: <?php echo esc_attr($icon_font_size); ?>;
|
203 |
+
<?php endif; ?><?php if (!empty($icon_background_color)) : ?>background: <?php echo esc_attr($icon_background_color); ?> none repeat scroll 0 0;
|
204 |
+
<?php endif; ?><?php if (!empty($icon_padding)) : ?>padding: <?php echo esc_attr($icon_padding); ?>;
|
205 |
+
<?php endif; ?><?php if (!empty($icon_margin)) : ?>margin: <?php echo esc_attr($icon_margin); ?>;
|
206 |
<?php endif; ?>
|
207 |
+
}
|
208 |
+
|
209 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.tabs-nav:hover .accordion-icons span {
|
210 |
+
<?php if (!empty($icon_color_hover)) : ?>color: <?php echo esc_attr($icon_color_hover); ?>;
|
|
|
211 |
<?php endif; ?>
|
212 |
+
}
|
213 |
+
|
214 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.tabs-content {
|
215 |
+
<?php if (!empty($body_background_color)) : ?>background-color: <?php echo esc_attr($body_background_color); ?>;
|
216 |
+
<?php endif; ?><?php if (!empty($body_color)) : ?>color: <?php echo esc_attr($body_color); ?>;
|
217 |
+
<?php endif; ?><?php if (!empty($body_font_size)) : ?>font-size: <?php echo esc_attr($body_font_size); ?>;
|
218 |
+
<?php endif; ?><?php if (!empty($body_margin)) : ?>margin: <?php echo esc_attr($body_margin); ?>;
|
219 |
+
<?php endif; ?><?php if (!empty($body_padding)) : ?>padding: <?php echo esc_attr($body_padding); ?>;
|
220 |
<?php endif; ?>
|
|
|
|
|
|
|
221 |
}
|
222 |
+
|
223 |
+
#accordions-tabs-<?php echo esc_attr($post_id); ?>.accordion-icons span {
|
224 |
+
<?php if (!empty($icon_color)) : ?>color: <?php echo esc_attr($icon_color); ?>;
|
225 |
+
<?php endif; ?><?php if (!empty($icon_font_size)) : ?>font-size: <?php echo esc_attr($icon_font_size); ?>;
|
226 |
+
<?php endif; ?>
|
|
|
|
|
227 |
}
|
228 |
+
|
229 |
<?php
|
230 |
+
if (!empty($accordions_custom_css)) {
|
231 |
echo esc_attr($accordions_custom_css);
|
232 |
}
|
233 |
+
if ($tabs_icon_toggle == 'yes') {
|
234 |
+
?>.accordions-tabs .ui-tabs-active .accordions-tab-plus {
|
|
|
235 |
display: none;
|
236 |
}
|
237 |
+
|
238 |
.accordions-tabs .ui-tabs-active .accordions-tab-minus {
|
239 |
display: inline;
|
240 |
}
|
241 |
+
|
242 |
<?php
|
243 |
+
}
|
244 |
+
if ($tabs_is_vertical == 'yes') {
|
245 |
|
246 |
+
$nav_width_ratio = ($navs_width_ratio + 5);
|
247 |
+
$panel_width_ratio = (100 - $nav_width_ratio);
|
248 |
|
249 |
|
250 |
+
?>.ui-tabs-vertical .ui-tabs-nav {
|
251 |
+
float: left;
|
252 |
+
width: <?php echo esc_attr($navs_width_ratio); ?>%;
|
253 |
+
overflow: hidden;
|
254 |
+
}
|
255 |
+
|
256 |
+
.ui-tabs-vertical .ui-tabs-nav li {
|
257 |
+
clear: left;
|
258 |
+
width: 100%;
|
259 |
+
}
|
260 |
+
|
261 |
+
.ui-tabs-vertical .ui-tabs-panel {
|
262 |
+
padding: 1em;
|
263 |
+
float: left;
|
264 |
+
width: <?php echo esc_attr($panel_width_ratio); ?>%;
|
265 |
+
}
|
266 |
+
|
267 |
<?php
|
268 |
+
}
|
269 |
+
?>
|
270 |
</style>
|
271 |
<?php
|
272 |
}
|
279 |
|
280 |
add_action('accordions_tabs_main', 'accordions_tabs_main_items');
|
281 |
|
282 |
+
function accordions_tabs_main_items($atts)
|
283 |
+
{
|
284 |
|
285 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
286 |
+
$accordions_options = get_post_meta($post_id, 'accordions_options', true);
|
287 |
$accordions_options = !empty($accordions_options) ? $accordions_options : accordions_old_options($post_id);
|
288 |
|
289 |
|
310 |
|
311 |
|
312 |
|
313 |
+
if (empty($accordions_content)) {
|
314 |
|
315 |
$accordions_content = accordions_old_content($post_id);
|
316 |
//var_dump($accordions_content);
|
321 |
$nav_content_html = '';
|
322 |
$active_index = array();
|
323 |
|
324 |
+
if (!empty($accordions_content)) :
|
325 |
|
326 |
+
$item_count = 0;
|
327 |
|
328 |
+
foreach ($accordions_content as $index => $accordion) {
|
329 |
|
330 |
+
$accordion_hide = isset($accordion['hide']) ? $accordion['hide'] : '';
|
331 |
|
332 |
+
if ($accordion_hide == 'true') continue;
|
333 |
|
334 |
|
335 |
+
$accordion_header = isset($accordion['header']) ? $accordion['header'] : '';
|
336 |
+
$accordion_body = isset($accordion['body']) ? $accordion['body'] : '';
|
337 |
|
338 |
+
$accordion_is_active = isset($accordion['is_active']) ? $accordion['is_active'] : '';
|
339 |
+
$toggled_text = isset($accordion['toggled_text']) ? $accordion['toggled_text'] : '';
|
340 |
+
$active_icon = !empty($accordion['active_icon']) ? $accordion['active_icon'] : $icon_active;
|
341 |
+
$inactive_icon = !empty($accordion['inactive_icon']) ? $accordion['inactive_icon'] : $icon_inactive;
|
342 |
|
343 |
|
344 |
+
$accordion_header = apply_filters('accordions_item_header', $accordion_header, $post_id);
|
345 |
|
346 |
+
if (($accordion_is_active == 'yes')) {
|
347 |
+
$active_index[$index] = $item_count;
|
348 |
+
}
|
349 |
|
350 |
|
351 |
|
352 |
+
if (!in_array('accordions-pro/accordions-pro.php', (array) $active_plugins)) {
|
353 |
+
if (has_shortcode($accordion_body, 'accordions_tabs') || has_shortcode($accordion_body, 'accordions_tabs_pplugins')) {
|
354 |
+
$accordion_body = str_replace('[accordions_tabs', '**<a target="_blank" href="https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=wordpress.org"> <strong>Please buy pro to create nested tabs</strong></a>**', $accordion_body);
|
355 |
+
$accordion_body = str_replace('[accordions_tabs_pplugins', '**<a target="_blank" href="https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=wordpress.org"> <strong>Please buy pro to create nested tabs</strong></a>**', $accordion_body);
|
|
|
356 |
}
|
357 |
+
}
|
358 |
|
359 |
|
360 |
|
361 |
+
$accordion_body = apply_filters('accordions_item_body', $accordion_body, $post_id);
|
362 |
|
363 |
|
364 |
+
if ($enable_autoembed == 'yes') {
|
365 |
+
$WP_Embed = new WP_Embed();
|
366 |
+
$accordion_body = $WP_Embed->autoembed($accordion_body);
|
367 |
+
}
|
368 |
|
369 |
+
if ($enable_wpautop == 'yes') {
|
370 |
+
$accordion_body = wpautop($accordion_body);
|
371 |
+
}
|
372 |
|
373 |
+
if ($enable_shortcode == 'yes') {
|
374 |
+
$accordion_body = do_shortcode($accordion_body);
|
375 |
+
}
|
376 |
|
377 |
|
378 |
+
ob_start();
|
379 |
+
?>
|
380 |
+
<li post_id="<?php echo $post_id; ?>" header_id="header-<?php echo $index; ?>" id="header-<?php echo $index; ?>" style="" class="tabs-nav head<?php echo $index; ?> <?php echo $header_class; ?>" toggle-text="<?php echo do_shortcode(esc_attr($toggled_text)); ?>" main-text="<?php echo do_shortcode(esc_attr($accordion_header)); ?>">
|
381 |
|
382 |
+
<?php
|
383 |
+
if ($icon_position == 'left') :
|
384 |
+
?>
|
385 |
|
386 |
<a style="" class="accordions-tab-head" href="#tabs-<?php echo $index; ?>">
|
387 |
<span id="accordion-icons-<?php echo $index; ?>" class="accordion-icons">
|
390 |
</span>
|
391 |
<span id="header-text-<?php echo $index; ?>" class="accordions-head-title"><?php echo do_shortcode($accordion_header); ?></span>
|
392 |
</a>
|
393 |
+
<?php
|
394 |
+
elseif ($icon_position == 'right') :
|
395 |
+
?>
|
396 |
+
<a style="" class="accordions-tab-head" href="#tabs-<?php echo $index; ?>">
|
397 |
+
<span id="header-text-<?php echo $index; ?>" class="accordions-head-title"><?php echo do_shortcode($accordion_header); ?></span>
|
398 |
+
<span id="accordion-icons-<?php echo $index; ?>" class="accordion-icons">
|
399 |
+
<span class="accordion-icon-active accordion-plus"><?php echo $active_icon; ?></span>
|
400 |
+
<span class="accordion-icon-inactive accordion-minus"><?php echo $inactive_icon; ?></span>
|
401 |
+
</span>
|
402 |
+
</a>
|
403 |
|
404 |
+
<?php
|
405 |
+
endif;
|
406 |
+
?>
|
407 |
|
408 |
|
409 |
+
</li>
|
410 |
|
411 |
+
<?php
|
412 |
+
$nav_html .= ob_get_clean();
|
413 |
|
414 |
+
ob_start();
|
415 |
+
?>
|
416 |
|
417 |
|
418 |
+
<div class="tabs-content tabs-content<?php echo $index; ?> <?php echo $body_class; ?>" id="tabs-<?php echo $index; ?>">
|
419 |
+
<?php echo $accordion_body; ?>
|
420 |
+
</div>
|
421 |
|
422 |
+
<?php
|
423 |
+
$nav_content_html .= ob_get_clean();
|
424 |
|
425 |
+
$item_count++;
|
426 |
+
}
|
427 |
+
else :
|
428 |
|
429 |
+
do_action('accordions_tabs_main_no_content', $post_id);
|
430 |
+
endif;
|
431 |
|
432 |
+
?>
|
433 |
|
434 |
<ul>
|
435 |
<?php echo $nav_html; ?>
|
436 |
</ul>
|
437 |
<?php echo $nav_content_html; ?>
|
438 |
<script>
|
439 |
+
(function($) {
|
440 |
+
|
441 |
+
$(document).on("ready",function(){
|
442 |
<?php
|
443 |
+
if (isset($_GET['active_index'])) :
|
444 |
$accordion_index = isset($_GET['active_index']) ? esc_attr($_GET['active_index']) : '';
|
445 |
$accordion_index = explode('-', $accordion_index);
|
446 |
+
foreach ($accordion_index as $args) {
|
447 |
$args_arr = explode('|', $args);
|
448 |
$accordion_id = isset($args_arr[0]) ? $args_arr[0] : '';
|
449 |
$accordion_indexes = isset($args_arr[1]) ? $args_arr[1] : '';
|
450 |
+
?>
|
451 |
accordions_tabs_active_index_<?php echo $accordion_id; ?> = <?php echo $accordion_indexes; ?>;
|
452 |
+
<?php
|
453 |
}
|
454 |
+
else :
|
455 |
+
?>
|
456 |
+
accordions_tabs_active_index_<?php echo $post_id; ?> = <?php echo json_encode($active_index); ?>;
|
457 |
+
<?php
|
458 |
endif;
|
459 |
?>
|
460 |
+
})})(jQuery);
|
461 |
</script>
|
462 |
<?php
|
463 |
|
466 |
|
467 |
add_action('accordions_tabs_main', 'accordions_tabs_main_edit_link');
|
468 |
|
469 |
+
function accordions_tabs_main_edit_link($atts)
|
470 |
+
{
|
471 |
|
472 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
473 |
|
480 |
|
481 |
|
482 |
|
483 |
+
if (current_user_can('administrator') && $hide_edit == 'no') {
|
484 |
$admin_url = admin_url();
|
485 |
+
$accordion_edit_url = apply_filters('accordions_edit_url', '' . $admin_url . 'post.php?post=' . $post_id . '&action=edit');
|
486 |
|
487 |
+
?>
|
488 |
+
<div class="accordion-edit"><a href="<?php echo $accordion_edit_url; ?>"><?php echo __('Edit this accordion', 'accordions'); ?></a>, <?php echo __("Only admin can see this.", 'accordions') ?></div>
|
489 |
+
<?php
|
490 |
|
491 |
}
|
|
|
492 |
}
|
493 |
|
494 |
|
499 |
|
500 |
add_action('accordions_tabs_main', 'accordions_tabs_main_scripts');
|
501 |
|
502 |
+
function accordions_tabs_main_scripts($atts)
|
503 |
+
{
|
504 |
|
505 |
$post_id = isset($atts['id']) ? $atts['id'] : '';
|
506 |
|
507 |
+
$accordions_options = get_post_meta($post_id, 'accordions_options', true);
|
508 |
$accordions_options = !empty($accordions_options) ? $accordions_options : accordions_old_options($post_id);
|
509 |
|
510 |
$custom_scripts = isset($accordions_options['custom_scripts']) ? $accordions_options['custom_scripts'] : array();
|
518 |
$tabs_is_vertical = isset($tabs['is_vertical']) ? $tabs['is_vertical'] : '';
|
519 |
?>
|
520 |
<script>
|
521 |
+
(function($) {
|
522 |
+
|
523 |
+
$(document).on("ready",function(){
|
524 |
+
<?php
|
525 |
+
if ($tabs_is_vertical == 'yes') {
|
526 |
+
?>
|
527 |
+
$("#accordions-tabs-<?php echo $post_id; ?>").addClass("ui-tabs-vertical ui-helper-clearfix");
|
528 |
+
$("#accordions-tabs-<?php echo $post_id; ?> li").removeClass("ui-corner-top").addClass("ui-corner-left");
|
529 |
<?php
|
|
|
|
|
|
|
|
|
|
|
530 |
}
|
531 |
?>
|
532 |
+
$("#accordions-tabs-<?php echo $post_id; ?>").tabs({
|
533 |
collapsible: <?php echo $collapsible; ?>,
|
534 |
event: "<?php echo $active_event; ?>",
|
535 |
active: <?php echo $active_tab; ?>,
|
536 |
});
|
537 |
+
if (typeof accordions_tabs_active_index_<?php echo $post_id; ?> != 'undefined') {
|
538 |
$("#accordions-tabs-<?php echo $post_id; ?>").tabs("option", "active", accordions_tabs_active_index_<?php echo $post_id; ?>);
|
539 |
}
|
540 |
+
})})(jQuery);
|
541 |
</script>
|
542 |
<?php
|
543 |
+
if (!empty($custom_js)) :
|
544 |
+
?>
|
545 |
<script>
|
546 |
+
(function($) {
|
547 |
+
|
548 |
+
$(document).on("ready",function(){
|
549 |
<?php echo $custom_js; ?>
|
550 |
+
})})(jQuery);
|
551 |
</script>
|
552 |
<?php
|
553 |
endif;
|
555 |
|
556 |
|
557 |
add_action('accordions_tabs_main_no_content', 'accordions_tabs_main_no_content');
|
558 |
+
function accordions_tabs_main_no_content()
|
559 |
+
{
|
560 |
|
561 |
?>
|
562 |
+
<p><?php echo __('Content missing', ''); ?></p>
|
563 |
+
<?php
|
564 |
|
565 |
}
|
|