Accordion - Version 2.1.11

Version Description

Download this release

Release Info

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

Code changes from version 2.1.10 to 2.1.11

accordions.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accordions
4
  Plugin URI: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
5
  Description: Fully responsive and mobile ready accordion grid for wordpress.
6
- Version: 2.1.10
7
  WC requires at least: 3.0.0
8
  WC tested up to: 3.5
9
  Author: PickPlugins
@@ -23,9 +23,10 @@ class Accordions{
23
 
24
  define('accordions_plugin_url', plugins_url('/', __FILE__) );
25
  define('accordions_plugin_dir', plugin_dir_path( __FILE__ ) );
 
26
 
27
-
28
- require_once( plugin_dir_path( __FILE__ ) . 'includes/settings-tabs.php');
29
  require_once( plugin_dir_path( __FILE__ ) . 'includes/meta-new.php');
30
  require_once( plugin_dir_path( __FILE__ ) . 'includes/functions.php');
31
  require_once( plugin_dir_path( __FILE__ ) . 'includes/functions-wc.php');
3
  Plugin Name: Accordions
4
  Plugin URI: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
5
  Description: Fully responsive and mobile ready accordion grid for wordpress.
6
+ Version: 2.1.11
7
  WC requires at least: 3.0.0
8
  WC tested up to: 3.5
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.1.11' );
27
 
28
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/class-settings-tabs.php');
29
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/class-accordions-support.php');
30
  require_once( plugin_dir_path( __FILE__ ) . 'includes/meta-new.php');
31
  require_once( plugin_dir_path( __FILE__ ) . 'includes/functions.php');
32
  require_once( plugin_dir_path( __FILE__ ) . 'includes/functions-wc.php');
assets/admin/css/settings-tabs-bk.css ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @charset "utf-8";
2
+ /* CSS Document */
3
+
4
+
5
+ #accordions_metabox {
6
+ background: #f1f1f1 none repeat scroll 0 0;
7
+
8
+ }
9
+
10
+ #accordions_metabox .inside {
11
+ margin: 0;
12
+ padding: 0;
13
+ }
14
+
15
+ #accordions_metabox .hndle {
16
+ background: #fff;
17
+ /* color: rgb(255, 255, 255); */
18
+ padding: 15px 15px;
19
+ }
20
+
21
+
22
+ .settings-tabs{}
23
+
24
+ .settings-tabs.vertical{}
25
+ .settings-tabs .tab-navs{
26
+ float: left;
27
+ margin: 0;
28
+ padding: 0;
29
+ }
30
+ .settings-tabs .tab-nav{
31
+ width: 200px;
32
+ padding: 12px 10px;
33
+ background: #fff;
34
+ margin: 0;
35
+ border-bottom: 1px solid #eee;
36
+ cursor: pointer;
37
+ font-size: 13px;
38
+ }
39
+
40
+ .settings-tabs .tab-nav.active{
41
+ background:#f1f1f1;
42
+ }
43
+
44
+ .settings-tabs .tab-content{
45
+ margin-left: 221px;
46
+ padding: 0;
47
+ background: #fff;
48
+ display: none;
49
+ }
50
+
51
+ .settings-tabs .tab-content.active{
52
+ display: block;
53
+ }
54
+
55
+
56
+
57
+ .settings-tabs .section{
58
+ margin: 0;
59
+ padding: 15px 0;
60
+ }
61
+ .settings-tabs .section-title{
62
+ padding: 0 15px;
63
+ font-size: 16px;
64
+ font-weight: 600;
65
+ }
66
+
67
+ .settings-tabs .section-description{
68
+ padding: 0 15px;
69
+ margin-bottom: 25px;
70
+ }
71
+
72
+
73
+
74
+ .settings-tabs .setting-field{
75
+ margin-bottom: 15px;
76
+ border-bottom: 1px solid #eee;
77
+ padding: 0 15px 15px 15px;
78
+ }
79
+ .settings-tabs .setting-field:last-child{
80
+ border-bottom: 1px solid #eee0;
81
+ }
82
+
83
+
84
+
85
+ .settings-tabs .setting-field .field-lable{
86
+ width: 270px;
87
+ float: left;
88
+ font-size: 14px;
89
+ }
90
+ .settings-tabs .setting-field .field-input{
91
+ margin-left: 270px;
92
+ }
93
+ .settings-tabs .setting-field .description{}
94
+
95
+
96
+
97
+
98
+
99
+
100
+ /*input*/
101
+
102
+ .settings-tabs input[type="text"], .settings-tabs textarea, .settings-tabs select, .settings-tabs input[type="range"]{
103
+ width: 260px;
104
+ }
105
+
106
+
107
+ @media (max-width: 1440px){
108
+
109
+ .settings-tabs .setting-field .field-lable{
110
+ width: auto;
111
+ float: none;
112
+ font-size: 14px;
113
+ }
114
+ .settings-tabs .setting-field .field-input{
115
+ margin-left: 0px;
116
+ }
117
+ .settings-tabs .setting-field .description{}
118
+
119
+ }
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
assets/admin/css/settings-tabs.css CHANGED
@@ -2,30 +2,44 @@
2
  /* CSS Document */
3
 
4
 
5
- #accordions_metabox {
6
- background: #f1f1f1 none repeat scroll 0 0;
7
 
 
 
8
  }
9
 
10
- #accordions_metabox .inside {
11
- margin: 0;
12
- padding: 0;
13
  }
14
 
15
- #accordions_metabox .hndle {
16
- background: #fff;
17
- /* color: rgb(255, 255, 255); */
18
- padding: 15px 15px;
19
  }
20
 
21
 
22
- .settings-tabs{}
23
 
24
- .settings-tabs.vertical{}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  .settings-tabs .tab-navs{
26
  float: left;
27
  margin: 0;
28
  padding: 0;
 
 
29
  }
30
  .settings-tabs .tab-nav{
31
  width: 200px;
@@ -38,13 +52,13 @@
38
  }
39
 
40
  .settings-tabs .tab-nav.active{
41
- background:#f1f1f1;
42
  }
43
 
44
  .settings-tabs .tab-content{
45
- margin-left: 221px;
46
  padding: 0;
47
- background: #fff;
48
  display: none;
49
  }
50
 
@@ -100,10 +114,13 @@
100
  /*input*/
101
 
102
  .settings-tabs input[type="text"], .settings-tabs textarea, .settings-tabs select, .settings-tabs input[type="range"]{
103
- width: 260px;
104
  }
105
 
106
 
 
 
 
107
  @media (max-width: 1440px){
108
 
109
  .settings-tabs .setting-field .field-lable{
@@ -120,11 +137,98 @@
120
 
121
 
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
 
125
 
 
 
 
 
126
 
127
 
 
128
 
 
 
 
 
 
 
 
129
 
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /* CSS Document */
3
 
4
 
5
+ /*General CSS*/
 
6
 
7
+ .settings-tabs .float-right{
8
+ float: right;
9
  }
10
 
11
+ .settings-tabs .float-left{
12
+ float: right;
 
13
  }
14
 
15
+ .settings-tabs .float-none{
16
+ float: right;
 
 
17
  }
18
 
19
 
 
20
 
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+ .settings-tabs{
31
+ background: #fff;
32
+ }
33
+
34
+ .settings-tabs.vertical{
35
+ position: relative;
36
+ }
37
  .settings-tabs .tab-navs{
38
  float: left;
39
  margin: 0;
40
  padding: 0;
41
+ position: sticky;
42
+ top: 32px;
43
  }
44
  .settings-tabs .tab-nav{
45
  width: 200px;
52
  }
53
 
54
  .settings-tabs .tab-nav.active{
55
+ background:#f1f1f159;
56
  }
57
 
58
  .settings-tabs .tab-content{
59
+ margin-left: 220px;
60
  padding: 0;
61
+ background: #f1f1f159;
62
  display: none;
63
  }
64
 
114
  /*input*/
115
 
116
  .settings-tabs input[type="text"], .settings-tabs textarea, .settings-tabs select, .settings-tabs input[type="range"]{
117
+ width: 360px;
118
  }
119
 
120
 
121
+
122
+
123
+
124
  @media (max-width: 1440px){
125
 
126
  .settings-tabs .setting-field .field-lable{
137
 
138
 
139
 
140
+ /*expandable*/
141
+
142
+
143
+ .settings-tabs .expandable{}
144
+ .settings-tabs .expandable .item {
145
+
146
+ margin: 1px 0;
147
+
148
+ }
149
+
150
+
151
+ .settings-tabs .expandable .header label{
152
+
153
+ }
154
 
155
 
156
 
157
+ .settings-tabs .expandable .header {
158
+ background: #eee none repeat scroll 0 0;
159
+
160
+ }
161
 
162
 
163
+ .settings-tabs .expandable {
164
 
165
+ }
166
+
167
+ .settings-tabs .expandable .options {
168
+ background: #bde6fc;
169
+ display: none;
170
+ padding: 10px;
171
+ }
172
 
173
 
174
+
175
+ .settings-tabs .expandable .options {
176
+ background:#f1f1f1;
177
+ display: none;
178
+ padding: 10px;
179
+ }
180
+
181
+
182
+ .settings-tabs .expandable .item.ui-sortable-helper {
183
+ border: 1px dashed rgb(153, 153, 153);
184
+ }
185
+
186
+
187
+
188
+ .settings-tabs .expandable .header {
189
+ padding: 5px;
190
+
191
+ }
192
+
193
+ .settings-tabs .expandable .active .options {
194
+
195
+ display: block;
196
+
197
+ }
198
+
199
+ .settings-tabs .item .expand .fa-expand {
200
+ display: inline-block;
201
+ }
202
+
203
+ .settings-tabs .item .expand .fa-compress {
204
+ display: none;
205
+ }
206
+ .settings-tabs .item.active .expand .fa-compress {
207
+ display: inline-block;
208
+ }
209
+ .settings-tabs .item.active .expand .fa-expand {
210
+ display: none;
211
+ }
212
+
213
+
214
+
215
+ .settings-tabs .expandable .item .move {
216
+ display: inline-block;
217
+ padding: 5px;
218
+ cursor: move;
219
+ }
220
+
221
+ .settings-tabs .expandable .item .expand {
222
+ display: inline-block;
223
+ padding: 5px;
224
+ cursor: pointer;
225
+ }
226
+
227
+ .settings-tabs .expandable .remove {
228
+ background: rgb(228, 65, 8) none repeat scroll 0 0;
229
+ color: rgb(255, 255, 255);
230
+ cursor: pointer;
231
+ margin-right: 10px;
232
+ padding: 2px 7px;
233
+ border-radius: 3px;
234
+ }
assets/admin/js/scripts.js CHANGED
@@ -50,7 +50,7 @@ jQuery(document).ready(function($)
50
  $(this).removeAttr('expand');
51
  $(this).text('Expand all');
52
 
53
- $('#accordions-content .items').removeClass('active');
54
  $(this).attr('collapse','yes');
55
 
56
 
@@ -59,7 +59,7 @@ jQuery(document).ready(function($)
59
  $(this).text('Collapse all');
60
 
61
  $(this).attr('expand','yes');
62
- $('#accordions-content .items').addClass('active');
63
  }
64
 
65
 
50
  $(this).removeAttr('expand');
51
  $(this).text('Expand all');
52
 
53
+ $('#accordions-content .item').removeClass('active');
54
  $(this).attr('collapse','yes');
55
 
56
 
59
  $(this).text('Collapse all');
60
 
61
  $(this).attr('expand','yes');
62
+ $('#accordions-content .item').addClass('active');
63
  }
64
 
65
 
assets/admin/js/settings-tabs.js CHANGED
@@ -1,9 +1,61 @@
1
  jQuery(document).ready(function($){
 
 
 
2
  $(document).on('click','.settings-tabs .tab-nav',function(){
 
3
  $(this).parent().parent().children('.tab-navs').children('.tab-nav').removeClass('active');
 
4
  $(this).addClass('active');
 
5
  id = $(this).attr('data-id');
 
 
 
 
6
  $(this).parent().parent().children('.tab-content').removeClass('active');
 
7
  $(this).parent().parent().children('.tab-content#'+id).addClass('active');
 
 
8
  })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  });
1
  jQuery(document).ready(function($){
2
+
3
+
4
+
5
  $(document).on('click','.settings-tabs .tab-nav',function(){
6
+
7
  $(this).parent().parent().children('.tab-navs').children('.tab-nav').removeClass('active');
8
+
9
  $(this).addClass('active');
10
+
11
  id = $(this).attr('data-id');
12
+
13
+ //console.log('Hello click');
14
+ console.log(id);
15
+
16
  $(this).parent().parent().children('.tab-content').removeClass('active');
17
+
18
  $(this).parent().parent().children('.tab-content#'+id).addClass('active');
19
+
20
+
21
  })
22
+
23
+
24
+
25
+
26
+ $(document).on('click', '.settings-tabs .expandable .expand', function(){
27
+ if($(this).parent().parent().hasClass('active'))
28
+ {
29
+ $(this).parent().parent().removeClass('active');
30
+ }
31
+ else
32
+ {
33
+ $(this).parent().parent().addClass('active');
34
+ }
35
+
36
+
37
+ })
38
+
39
+
40
+
41
+
42
+ $(document).on('click', '.settings-tabs .remove', function(){
43
+
44
+ var is_confirm = $(this).attr('confirm');
45
+
46
+ if(is_confirm=='yes'){
47
+ $(this).parent().parent().remove();
48
+ }
49
+ else{
50
+
51
+ $(this).html('<i class="fas fa-trash-alt"></i>');
52
+ $(this).attr('confirm','yes');
53
+
54
+ }
55
+
56
+
57
+ })
58
+
59
+
60
+
61
  });
assets/global/css/themes.style.css CHANGED
@@ -4,6 +4,7 @@
4
 
5
 
6
 
 
7
  .accordions .accordions-head .ui-accordion-header-icon {
8
  display: none;
9
  }
4
 
5
 
6
 
7
+
8
  .accordions .accordions-head .ui-accordion-header-icon {
9
  display: none;
10
  }
includes/class-accordions-support.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: License Manager - Clients
4
+ Plugin URI: http://pickplugins.com
5
+ Description: Awesome Question and Answer.
6
+ Version: 2.0.1
7
+ Text Domain: question-answer
8
+ Author: pickplugins
9
+ Author URI: http://pickplugins.com
10
+ License: GPLv2 or later
11
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
+ */
13
+
14
+ if ( ! defined('ABSPATH')) exit; // if direct access
15
+
16
+
17
+ if( ! class_exists( 'class_accordions_support' ) ) {
18
+ class class_accordions_support
19
+ {
20
+
21
+ public function __construct()
22
+ {
23
+
24
+
25
+ //add_action( 'init', array( $this, 'check_plugin_update' ), 12 );
26
+
27
+ }
28
+
29
+ public function our_plugins()
30
+ {
31
+
32
+ $our_plugins = array(
33
+ array(
34
+ 'title' => 'Post Grid',
35
+ 'link' => 'http://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/',
36
+ 'thumb' => 'https://www.pickplugins.com/wp-content/uploads/2015/12/3814-post-grid-thumb-500x262.jpg',
37
+ ),
38
+
39
+ array(
40
+ 'title' => 'Woocommerce Products Slider',
41
+ 'link' => 'http://www.pickplugins.com/item/woocommerce-products-slider-for-wordpress/',
42
+ 'thumb' => 'https://www.pickplugins.com/wp-content/uploads/2016/03/4357-woocommerce-products-slider-thumb-500x250.jpg',
43
+ ),
44
+
45
+ array(
46
+ 'title' => 'Team Showcase',
47
+ 'link' => 'http://www.pickplugins.com/item/team-responsive-meet-the-team-grid-for-wordpress/',
48
+ 'thumb' => 'https://www.pickplugins.com/wp-content/uploads/2016/06/5145-team-thumb-500x250.jpg',
49
+ ),
50
+
51
+ array(
52
+ 'title' => 'Job Board Manager',
53
+ 'link' => 'https://wordpress.org/plugins/job-board-manager/',
54
+ 'thumb' => 'https://www.pickplugins.com/wp-content/uploads/2015/08/3466-job-board-manager-thumb-500x250.png',
55
+ ),
56
+
57
+ array(
58
+ 'title' => 'Wishlist for WooCommerce',
59
+ 'link' => 'https://www.pickplugins.com/item/woocommerce-wishlist/',
60
+ 'thumb' => 'https://www.pickplugins.com/wp-content/uploads/2017/10/12047-woocommerce-wishlist.png',
61
+ ),
62
+
63
+ array(
64
+ 'title' => 'Breadcrumb',
65
+ 'link' => 'https://www.pickplugins.com/item/breadcrumb-awesome-breadcrumbs-style-navigation-for-wordpress/',
66
+ 'thumb' => 'https://www.pickplugins.com/wp-content/uploads/2016/03/4242-breadcrumb-500x252.png',
67
+ ),
68
+
69
+ array(
70
+ 'title' => 'Pricing Table',
71
+ 'link' => 'https://www.pickplugins.com/item/pricing-table/',
72
+ 'thumb' => 'https://www.pickplugins.com/wp-content/uploads/2016/10/7042-pricing-table-thumbnail-500x250.png',
73
+ ),
74
+
75
+ );
76
+
77
+ return apply_filters('accordions_our_plugins', $our_plugins);
78
+
79
+
80
+ }
81
+
82
+
83
+ public function video_tutorials()
84
+ {
85
+
86
+ $tutorials = array(
87
+ array(
88
+ 'title' => __('Customize content', 'woocommerce-products-slider'),
89
+ 'video_url' => 'https://www.youtube.com/watch?v=cRjaVwlih6Q&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
90
+ ),
91
+ array(
92
+ 'title' => __('Enable search', 'woocommerce-products-slider'),
93
+ 'video_url' => 'https://www.youtube.com/watch?v=oLJw6kBHau0&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
94
+ ),
95
+
96
+ array(
97
+ 'title' => __('Click header to scroll top', 'woocommerce-products-slider'),
98
+ 'video_url' => 'https://www.youtube.com/watch?v=CIcRBoQ5CO4&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
99
+ ),
100
+ array(
101
+ 'title' => __('Enable lazy load', 'woocommerce-products-slider'),
102
+ 'video_url' => 'https://www.youtube.com/watch?v=aKVK5gW1BKA&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
103
+ ),
104
+
105
+
106
+ array(
107
+ 'title' => __('Hide edit link', 'woocommerce-products-slider'),
108
+ 'video_url' => 'https://www.youtube.com/watch?v=OvVolGXpnn0&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
109
+ ),
110
+
111
+ array(
112
+ 'title' => __('Create nested or multi-level accordion', 'woocommerce-products-slider'),
113
+ 'video_url' => 'https://www.youtube.com/watch?v=Z_iKPNDMEBs&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
114
+ ),
115
+
116
+ array(
117
+ 'title' => __('Customize header', 'woocommerce-products-slider'),
118
+ 'video_url' => 'https://www.youtube.com/watch?v=skU3J0JpcBU&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
119
+ ),
120
+
121
+ array(
122
+ 'title' => __('Customize icons', 'woocommerce-products-slider'),
123
+ 'video_url' => 'https://www.youtube.com/watch?v=-ATeH0j6-t4&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
124
+ ),
125
+
126
+ array(
127
+ 'title' => __('Open/active via url', 'woocommerce-products-slider'),
128
+ 'video_url' => 'https://www.youtube.com/watch?v=PaxUawdnmfA&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
129
+ ),
130
+ array(
131
+ 'title' => __('Open/active on page load', 'woocommerce-products-slider'),
132
+ 'video_url' => 'https://www.youtube.com/watch?v=Dqd2zSpCQlo&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
133
+ ),
134
+
135
+ array(
136
+ 'title' => __('How to create accordion', 'woocommerce-products-slider'),
137
+ 'video_url' => 'https://www.youtube.com/watch?v=9PS63kqe20M&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
138
+ ),
139
+ array(
140
+ 'title' => __('How to install accordions', 'woocommerce-products-slider'),
141
+ 'video_url' => 'https://www.youtube.com/watch?v=ecYxS3Udjz4&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
142
+ ),
143
+
144
+ array(
145
+ 'title' => __('WooCommerce product faq tab', 'woocommerce-products-slider'),
146
+ 'video_url' => 'https://www.youtube.com/watch?v=1yeIpc52p2Y&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
147
+ ),
148
+ array(
149
+ 'title' => __('Expand/collapse all button', 'woocommerce-products-slider'),
150
+ 'video_url' => 'https://www.youtube.com/watch?v=Ah10F3co83o&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
151
+ ),
152
+
153
+ array(
154
+ 'title' => __('Accordions click track', 'woocommerce-products-slider'),
155
+ 'video_url' => 'https://www.youtube.com/watch?v=qbCsynoaT_Q&list=PL2GPPfgLrfWzOWsRCgV5Qytg6aImGPbCE',
156
+ ),
157
+
158
+
159
+ );
160
+
161
+ return apply_filters('accordions_video_tutorials', $tutorials);
162
+
163
+
164
+ }
165
+
166
+
167
+ public function faq(){
168
+
169
+ $faq = array(
170
+
171
+
172
+ array(
173
+ 'title'=>'Create accordion',
174
+ 'url'=>'https://www.pickplugins.com/documentation/accordions/faq/how-to-create-accordion/?ref=dashboard',
175
+ ),
176
+ array(
177
+ 'title'=>'Upgrade to premium?',
178
+ 'url'=>'https://www.pickplugins.com/documentation/accordions/faq/upgrade-to-premium/?ref=dashboard',
179
+ ),
180
+
181
+
182
+ array(
183
+ 'title'=>'Create nested accordion',
184
+ 'url'=>'https://www.pickplugins.com/documentation/accordions/faq/how-to-create-nested-accordion/?ref=dashboard',
185
+
186
+ ),
187
+ array(
188
+ 'title'=>'Accordion open/closed on load',
189
+ 'url'=>'https://www.pickplugins.com/documentation/accordions/faq/accordion-openclosed-on-load/?ref=dashboard',
190
+
191
+ ),
192
+
193
+ array(
194
+ 'title'=>'Filter accordion header',
195
+ 'url'=>'https://www.pickplugins.com/documentation/accordions/filter-hooks/filter-hook-accordions_filter_title/?ref=dashboard',
196
+ ),
197
+
198
+ array(
199
+ 'title'=>'Filter accordion content',
200
+ 'url'=>'https://www.pickplugins.com/documentation/accordions/filter-hooks/filter-hook-accordions_filter_content/?ref=dashboard',
201
+ ),
202
+ array(
203
+ 'title'=>'Open/activate via URL parameter',
204
+ 'url'=>'https://www.pickplugins.com/documentation/accordions/faq/how-to-openactivate-via-url-parameter/?ref=dashboard',
205
+ ),
206
+
207
+ array(
208
+ 'title'=>'Custom header background image',
209
+ 'url'=>'https://www.pickplugins.com/documentation/accordions/faq/custom-header-background-image/?ref=dashboard',
210
+ ),
211
+
212
+
213
+
214
+
215
+
216
+
217
+ );
218
+
219
+
220
+ return apply_filters('accordions_faq', $faq);
221
+
222
+
223
+ }
224
+
225
+
226
+ }
227
+ }
includes/class-settings-tabs.php ADDED
@@ -0,0 +1,694 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * @Author pickplugins
5
+ * Copyright: 2015 pickplugins
6
+ */
7
+
8
+ if ( ! defined('ABSPATH')) exit; // if direct access
9
+
10
+ if( ! class_exists( 'settings_tabs_field' ) ) {
11
+ class settings_tabs_field{
12
+
13
+
14
+ function generate_field($option){
15
+
16
+ $id = isset( $option['id'] ) ? $option['id'] : "";
17
+ $type = isset( $option['type'] ) ? $option['type'] : "";
18
+ $details = isset( $option['details'] ) ? $option['details'] : "";
19
+
20
+
21
+
22
+
23
+
24
+
25
+ if( empty( $id ) ) return;
26
+
27
+ if( isset($option['type']) && $option['type'] === 'select' ) $this->field_select( $option );
28
+ elseif( isset($option['type']) && $option['type'] === 'select2') $this->field_select2( $option );
29
+ elseif( isset($option['type']) && $option['type'] === 'checkbox') $this->field_checkbox( $option );
30
+ elseif( isset($option['type']) && $option['type'] === 'radio') $this->field_radio( $option );
31
+ elseif( isset($option['type']) && $option['type'] === 'radio_image') $this->field_radio_image( $option );
32
+ elseif( isset($option['type']) && $option['type'] === 'textarea') $this->field_textarea( $option );
33
+ elseif( isset($option['type']) && $option['type'] === 'scripts_js') $this->field_scripts_js( $option );
34
+ elseif( isset($option['type']) && $option['type'] === 'scripts_css') $this->field_scripts_css( $option );
35
+ elseif( isset($option['type']) && $option['type'] === 'number' ) $this->field_number( $option );
36
+ elseif( isset($option['type']) && $option['type'] === 'text' ) $this->field_text( $option );
37
+ elseif( isset($option['type']) && $option['type'] === 'text_icon' ) $this->field_text_icon( $option );
38
+ elseif( isset($option['type']) && $option['type'] === 'text_multi' ) $this->field_text_multi( $option );
39
+ elseif( isset($option['type']) && $option['type'] === 'range' ) $this->field_range( $option );
40
+ elseif( isset($option['type']) && $option['type'] === 'colorpicker') $this->field_colorpicker( $option );
41
+ elseif( isset($option['type']) && $option['type'] === 'datepicker') $this->field_datepicker( $option );
42
+ elseif( isset($option['type']) && $option['type'] === 'repeater') $this->field_repeater( $option );
43
+ elseif( isset($option['type']) && $option['type'] === 'faq') $this->field_faq( $option );
44
+ elseif( isset($option['type']) && $option['type'] === 'addons_grid') $this->field_addons_grid( $option );
45
+ elseif( isset($option['type']) && $option['type'] === 'custom_html') $this->field_custom_html( $option );
46
+
47
+
48
+
49
+
50
+ elseif( isset($option['type']) && $option['type'] === $type ) do_action( "settings_tabs_field_$type", $option );
51
+
52
+
53
+ //if( !empty( $details ) ) echo "<p class='description'>$details</p>";
54
+
55
+
56
+
57
+
58
+
59
+ }
60
+
61
+
62
+ public function field_select( $option ){
63
+
64
+ $id = isset( $option['id'] ) ? $option['id'] : "";
65
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
66
+ $args = isset( $option['args'] ) ? $option['args'] : array();
67
+ $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
68
+ $multiple = isset( $option['multiple'] ) ? $option['multiple'] : false;
69
+
70
+
71
+
72
+
73
+
74
+ $title = isset( $option['title'] ) ? $option['title'] : "";
75
+ $details = isset( $option['details'] ) ? $option['details'] : "";
76
+
77
+ if($multiple){
78
+ $value = isset( $option['value'] ) ? $option['value'] : array();
79
+ $field_name = !empty($parent) ? $parent.'['.$id.'][]' : $id.'[]';
80
+ $default = isset( $option['default'] ) ? $option['default'] : array();
81
+ }else{
82
+ $value = isset( $option['value'] ) ? $option['value'] : '';
83
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
84
+ $default = isset( $option['default'] ) ? $option['default'] : '';
85
+ }
86
+
87
+
88
+ $value = !empty($value) ? $value : $default;
89
+
90
+
91
+
92
+ ?>
93
+ <div class="setting-field">
94
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
95
+ <div class="field-input">
96
+ <select <?php if($multiple) echo 'multiple'; ?> name='<?php echo $field_name; ?>' id='<?php echo $id; ?>'>
97
+ <?php
98
+ foreach( $args as $key => $name ):
99
+ if($multiple){
100
+ $selected = in_array($key, $value) ? "selected" : "";
101
+ }else{
102
+ $selected = $value == $key ? "selected" : "";
103
+ }
104
+
105
+
106
+ ?>
107
+ <option <?php echo $selected; ?> value='<?php echo $key; ?>'><?php echo $name; ?></option>
108
+ <?php
109
+ endforeach;
110
+ ?>
111
+ </select>
112
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
113
+ </div>
114
+ </div>
115
+
116
+ <?php
117
+ }
118
+
119
+ public function field_select2( $option ){
120
+
121
+ $id = isset( $option['id'] ) ? $option['id'] : "";
122
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
123
+ $args = isset( $option['args'] ) ? $option['args'] : array();
124
+ $multiple = isset( $option['multiple'] ) ? $option['multiple'] : "";
125
+
126
+ if($multiple){
127
+ $value = isset( $option['value'] ) ? $option['value'] : array();
128
+ $field_name = !empty($parent) ? $parent.'['.$id.'][]' : $id.'[]';
129
+ $default = isset( $option['default'] ) ? $option['default'] : array();
130
+ }else{
131
+ $value = isset( $option['value'] ) ? $option['value'] : '';
132
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
133
+ $default = isset( $option['default'] ) ? $option['default'] : '';
134
+ }
135
+
136
+ $value = !empty($value) ? $value : $default;
137
+
138
+ //$value = get_post_meta( $post_id, $id, true );
139
+ $title = isset( $option['title'] ) ? $option['title'] : "";
140
+ $details = isset( $option['details'] ) ? $option['details'] : "";
141
+ ?>
142
+
143
+
144
+ <div class="setting-field">
145
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
146
+ <div class="field-input">
147
+ <select class="select2" <?php if($multiple) echo 'multiple'; ?> name='<?php echo $field_name; ?>' id='<?php echo $id; ?>'>
148
+ <?php
149
+ foreach( $args as $key => $name ):
150
+
151
+ if($multiple){
152
+ $selected = in_array($key, $value) ? "selected" : "";
153
+ }else{
154
+ $selected = ($key == $value) ? "selected" : "";
155
+ }
156
+
157
+ ?>
158
+ <option <?php echo $selected; ?> value='<?php echo $key; ?>'><?php echo $name; ?></option>
159
+ <?php
160
+ endforeach;
161
+ ?>
162
+ </select>
163
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
164
+ </div>
165
+ </div>
166
+
167
+ <?php
168
+ }
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+ public function field_text( $option ){
180
+
181
+ $id = isset( $option['id'] ) ? $option['id'] : "";
182
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
183
+ $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
184
+ $value = isset( $option['value'] ) ? $option['value'] : '';
185
+ $default = isset( $option['default'] ) ? $option['default'] : '';
186
+
187
+ $value = !empty($value) ? $value : $default;
188
+
189
+ $title = isset( $option['title'] ) ? $option['title'] : "";
190
+ $details = isset( $option['details'] ) ? $option['details'] : "";
191
+
192
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
193
+ ?>
194
+ <div class="setting-field">
195
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
196
+ <div class="field-input">
197
+ <input type='text' class='' name='<?php echo $field_name; ?>' id='<?php echo $id; ?>' placeholder='<?php echo $placeholder; ?>' value='<?php echo $value; ?>' />
198
+
199
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
200
+ </div>
201
+ </div>
202
+
203
+ <?php
204
+ }
205
+
206
+
207
+
208
+
209
+ public function field_text_icon( $option ){
210
+
211
+ $id = isset( $option['id'] ) ? $option['id'] : "";
212
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
213
+ $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
214
+ $value = isset( $option['value'] ) ? $option['value'] : '';
215
+ $default = isset( $option['default'] ) ? $option['default'] : '';
216
+
217
+ $title = isset( $option['title'] ) ? $option['title'] : "";
218
+ $details = isset( $option['details'] ) ? $option['details'] : "";
219
+
220
+
221
+ $option_value = empty($value) ? $default : $value;
222
+
223
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
224
+
225
+ ?>
226
+ <div class="setting-field">
227
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
228
+ <div class="field-input">
229
+
230
+ <div class="text-icon">
231
+ <span class="icon"><i class="<?php echo $option_value; ?>"></i></span><input type='text' class='' name='<?php echo $field_name; ?>' id='<?php echo $id; ?>' placeholder='<?php echo $placeholder; ?>' value='<?php echo $option_value; ?>' />
232
+ </div>
233
+
234
+
235
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
236
+ </div>
237
+ </div>
238
+
239
+ <script>
240
+
241
+ jQuery(document).ready(function($){
242
+ $(document).on('keyup', '.text-icon input', function () {
243
+
244
+ val = $(this).val();
245
+
246
+ if(val){
247
+ $(this).parent().children('.icon').html('<i class="'+val+'"></i>');
248
+ }
249
+
250
+
251
+
252
+ })
253
+
254
+ })
255
+
256
+ </script>
257
+
258
+
259
+ <style type="text/css">
260
+ .text-icon{}
261
+ .text-icon .icon{
262
+ /* width: 30px; */
263
+ background: #ddd;
264
+ /* height: 28px; */
265
+ display: inline-block;
266
+ vertical-align: top;
267
+ text-align: center;
268
+ font-size: 14px;
269
+ padding: 5px 10px;
270
+ line-height: normal;
271
+ }
272
+
273
+
274
+ </style>
275
+
276
+ <?php
277
+ }
278
+
279
+
280
+
281
+ public function field_range( $option ){
282
+
283
+ $id = isset( $option['id'] ) ? $option['id'] : "";
284
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
285
+
286
+ $value = isset( $option['value'] ) ? $option['value'] : '';
287
+ $default = isset( $option['default'] ) ? $option['default'] : '';
288
+ $value = !empty($value) ? $value : $default;
289
+
290
+ $args = isset( $option['args'] ) ? $option['args'] : "";
291
+
292
+ $min = isset($args['min']) ? $args['min'] : '';
293
+ $max = isset($args['max']) ? $args['max'] : '';
294
+ $step = isset($args['step']) ? $args['step'] : '';
295
+
296
+ $title = isset( $option['title'] ) ? $option['title'] : "";
297
+ $details = isset( $option['details'] ) ? $option['details'] : "";
298
+
299
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
300
+
301
+
302
+ ?>
303
+ <div class="setting-field">
304
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
305
+ <div class="field-input">
306
+
307
+ <div class="range-input">
308
+ <span class="range-value"><?php echo $value; ?></span><input type="range" min="<?php if($min) echo $min; ?>" max="<?php if($max) echo $max; ?>" step="<?php if($step) echo $step; ?>" class='' name='<?php echo $field_name; ?>' id='<?php echo $id; ?>' value='<?php echo $value; ?>' />
309
+
310
+ </div>
311
+
312
+
313
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
314
+ </div>
315
+ </div>
316
+
317
+ <style type="text/css">
318
+ .range-input{}
319
+ .range-input .range-value{
320
+ display: inline-block;
321
+ vertical-align: top;
322
+ margin: 0 0;
323
+ padding: 4px 10px;
324
+ background: #eee;
325
+ }
326
+ </style>
327
+
328
+ <script>
329
+
330
+ jQuery(document).ready(function($){
331
+
332
+
333
+ $(document).on('change', '#<?php echo $id; ?>', function () {
334
+
335
+ val = $(this).val();
336
+
337
+ if(val){
338
+ $(this).parent().children('.range-value').html(val);
339
+ }
340
+
341
+
342
+
343
+ })
344
+
345
+ })
346
+
347
+ </script>
348
+
349
+
350
+
351
+
352
+
353
+
354
+ <?php
355
+ }
356
+
357
+
358
+
359
+ public function field_textarea( $option ){
360
+
361
+ $id = isset( $option['id'] ) ? $option['id'] : "";
362
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
363
+ $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
364
+ $value = isset( $option['value'] ) ? $option['value'] : '';
365
+ $default = isset( $option['default'] ) ? $option['default'] : '';
366
+ $value = !empty($value) ? $value : $default;
367
+
368
+ $title = isset( $option['title'] ) ? $option['title'] : "";
369
+ $details = isset( $option['details'] ) ? $option['details'] : "";
370
+
371
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
372
+ ?>
373
+ <div class="setting-field">
374
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
375
+ <div class="field-input">
376
+ <textarea name='<?php echo $field_name; ?>' id='<?php echo $id; ?>' cols='40' rows='5' placeholder='<?php echo $placeholder; ?>'><?php echo $value; ?></textarea>
377
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
378
+ </div>
379
+ </div>
380
+
381
+ <?php
382
+ }
383
+
384
+
385
+
386
+ public function field_scripts_js( $option ){
387
+
388
+ $id = isset( $option['id'] ) ? $option['id'] : "";
389
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
390
+ $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
391
+ $value = isset( $option['value'] ) ? $option['value'] : '';
392
+ $default = isset( $option['default'] ) ? $option['default'] : '';
393
+ $value = !empty($value) ? $value : $default;
394
+
395
+
396
+ $title = isset( $option['title'] ) ? $option['title'] : "";
397
+ $details = isset( $option['details'] ) ? $option['details'] : "";
398
+
399
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
400
+
401
+
402
+ ?>
403
+ <div class="setting-field">
404
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
405
+ <div class="field-input">
406
+ <textarea name='<?php echo $field_name; ?>' id='<?php echo $id; ?>' cols='40' rows='5' placeholder='<?php echo $placeholder; ?>'><?php echo $value; ?></textarea>
407
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
408
+ </div>
409
+ </div>
410
+
411
+
412
+
413
+ <script>
414
+
415
+
416
+ var editor = CodeMirror.fromTextArea(document.getElementById("<?php echo $id; ?>"), {
417
+ lineNumbers: true,
418
+ //value: "function myScript(){return 100;}\n",
419
+
420
+ // mode: "javascript",
421
+ //scrollbarStyle: "simple"
422
+ });
423
+
424
+ // var editor = CodeMirror.fromTextArea(document.getElementById("custom_css"), {
425
+ // lineNumbers: true,
426
+ // scrollbarStyle: "simple"
427
+ // });
428
+
429
+ </script>
430
+
431
+ <?php
432
+ }
433
+
434
+
435
+ public function field_scripts_css( $option ){
436
+
437
+ $id = isset( $option['id'] ) ? $option['id'] : "";
438
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
439
+ $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
440
+ $value = isset( $option['value'] ) ? $option['value'] : '';
441
+ $default = isset( $option['default'] ) ? $option['default'] : '';
442
+ $value = !empty($value) ? $value : $default;
443
+
444
+ $title = isset( $option['title'] ) ? $option['title'] : "";
445
+ $details = isset( $option['details'] ) ? $option['details'] : "";
446
+
447
+
448
+
449
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
450
+ ?>
451
+ <div class="setting-field">
452
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
453
+ <div class="field-input">
454
+ <textarea name='<?php echo $field_name; ?>' id='<?php echo $id; ?>' cols='40' rows='5' placeholder='<?php echo $placeholder; ?>'><?php echo $value; ?></textarea>
455
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
456
+ </div>
457
+ </div>
458
+
459
+
460
+
461
+ <script>
462
+
463
+ var editor = CodeMirror.fromTextArea(document.getElementById("<?php echo $id; ?>"), {
464
+ lineNumbers: true,
465
+ value: "",
466
+ //scrollbarStyle: "simple"
467
+ });
468
+
469
+ </script>
470
+
471
+ <?php
472
+ }
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+ public function field_radio( $option ){
481
+
482
+ $id = isset( $option['id'] ) ? $option['id'] : "";
483
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
484
+ $title = isset( $option['title'] ) ? $option['title'] : "";
485
+ $details = isset( $option['details'] ) ? $option['details'] : "";
486
+ $for = isset( $option['for'] ) ? $option['for'] : "";
487
+ $args = isset( $option['args'] ) ? $option['args'] : array();
488
+
489
+ $option_value = isset( $option['value'] ) ? $option['value'] : '';
490
+ $default = isset( $option['default'] ) ? $option['default'] : '';
491
+ $option_value = !empty($option_value) ? $option_value : $default;
492
+
493
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
494
+
495
+
496
+
497
+
498
+ ?>
499
+ <div class="setting-field">
500
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
501
+ <div class="field-input">
502
+ <?php
503
+
504
+
505
+
506
+ if(!empty($args))
507
+ foreach( $args as $key => $value ):
508
+
509
+ $checked = ( $key == $option_value ) ? "checked" : "";
510
+
511
+ $for = !empty($for) ? $for.'-'.$id."-".$key : $id."-".$key;
512
+
513
+
514
+ ?>
515
+ <label for='<?php echo $for;?>'><input name='<?php echo $field_name; ?>' type='radio' id='<?php echo $for; ?>' value='<?php echo $key;?>' <?php echo $checked;?>><span><?php echo $value;?></span></label>
516
+ <?php
517
+
518
+
519
+ endforeach;
520
+
521
+ ?>
522
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
523
+ </div>
524
+ </div>
525
+ <?php
526
+
527
+
528
+ }
529
+
530
+
531
+
532
+ public function field_radio_image( $option ){
533
+
534
+ $id = isset( $option['id'] ) ? $option['id'] : "";
535
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
536
+ $args = isset( $option['args'] ) ? $option['args'] : array();
537
+ //$args = is_array( $args ) ? $args : $this->generate_args_from_string( $args );
538
+ $option_value = isset( $option['value'] ) ? $option['value'] : '';
539
+ $default = isset( $option['default'] ) ? $option['default'] : '';
540
+
541
+ $title = isset( $option['title'] ) ? $option['title'] : "";
542
+ $details = isset( $option['details'] ) ? $option['details'] : "";
543
+
544
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
545
+
546
+ //var_dump($option_value);
547
+
548
+ $option_value = empty($option_value) ? $default : $option_value;
549
+
550
+
551
+ ?>
552
+
553
+ <div class="setting-field">
554
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
555
+ <div class="field-input">
556
+
557
+ <div class="radio-img">
558
+ <?php
559
+ foreach( $args as $key => $value ):
560
+
561
+ $name = $value['name'];
562
+ $thumb = $value['thumb'];
563
+
564
+
565
+ $checked = ($key == $option_value) ? "checked" : "";
566
+
567
+ //var_dump($checked);
568
+
569
+ ?>
570
+ <label title="<?php echo $name; ?>" class="<?php if($checked =='checked') echo 'active';?>">
571
+ <input name='<?php echo $field_name; ?>' type='radio' id='<?php echo $id; ?>-<?php echo $key; ?>' value='<?php echo $key; ?>' <?php echo $checked; ?>>
572
+ <?php // echo $name; ?>
573
+ <img src="<?php echo $thumb; ?>">
574
+ </label>
575
+ <?php
576
+
577
+ endforeach;
578
+ ?>
579
+ </div>
580
+
581
+
582
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
583
+ </div>
584
+ </div>
585
+
586
+ <style type="text/css">
587
+ .radio-img{}
588
+ .radio-img label{
589
+ display: inline-block;
590
+ vertical-align: top;
591
+ margin: 0 0;
592
+ padding: 2px;
593
+ background: #eee;
594
+ }
595
+
596
+ .radio-img label.active{
597
+ background: #fd730d;
598
+ }
599
+
600
+ .radio-img input[type=radio]{
601
+ display: none;
602
+ }
603
+ .radio-img img{
604
+ width: 150px;
605
+ vertical-align: top;
606
+ }
607
+
608
+ </style>
609
+
610
+ <script>
611
+ jQuery(document).ready(function($){
612
+
613
+
614
+ $(document).on('click', '.radio-img label', function () {
615
+
616
+ $(this).parent().children('label').removeClass('active');
617
+
618
+ $(this).addClass('active');
619
+
620
+ })
621
+
622
+ })
623
+ </script>
624
+ <?php
625
+
626
+
627
+
628
+
629
+ }
630
+
631
+
632
+
633
+
634
+
635
+ public function field_colorpicker( $option ){
636
+
637
+ $id = isset( $option['id'] ) ? $option['id'] : "";
638
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
639
+ $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
640
+
641
+ $value = isset( $option['value'] ) ? $option['value'] : '';
642
+ $default = isset( $option['default'] ) ? $option['default'] : '';
643
+ $value = !empty($value) ? $value : $default;
644
+
645
+ $title = isset( $option['title'] ) ? $option['title'] : "";
646
+ $details = isset( $option['details'] ) ? $option['details'] : "";
647
+
648
+ $field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
649
+
650
+ ?>
651
+ <div class="setting-field">
652
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
653
+ <div class="field-input">
654
+ <input name='<?php echo $field_name; ?>' id='<?php echo $id; ?>' placeholder='<?php echo $placeholder; ?>' value="<?php echo $value; ?>" />
655
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
656
+ </div>
657
+ </div>
658
+ <?php
659
+
660
+
661
+ // echo "<input type='text' class='' name='$id' id='$id' placeholder='$placeholder' value='$value' />";
662
+
663
+ echo "<script>jQuery(document).ready(function($) { $('#$id').wpColorPicker();});</script>";
664
+ }
665
+
666
+
667
+
668
+ public function field_custom_html( $option ){
669
+
670
+ $id = isset( $option['id'] ) ? $option['id'] : "";
671
+ $parent = isset( $option['parent'] ) ? $option['parent'] : "";
672
+ $html = isset( $option['html'] ) ? $option['html'] : "";
673
+
674
+
675
+ $title = isset( $option['title'] ) ? $option['title'] : "";
676
+ $details = isset( $option['details'] ) ? $option['details'] : "";
677
+
678
+ ?>
679
+ <div class="setting-field">
680
+ <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
681
+ <div class="field-input">
682
+
683
+ <?php echo $html; ?>
684
+
685
+ <p class="description"><?php if(!empty($details)) echo $details; ?></p>
686
+ </div>
687
+ </div>
688
+
689
+ <?php
690
+ }
691
+
692
+
693
+
694
+ }}
includes/class-settings.php CHANGED
@@ -232,7 +232,7 @@ $args = array(
232
  ),
233
  );
234
 
235
- $WPAdminSettings = new WPAdminSettings( $args );
236
 
237
 
238
 
232
  ),
233
  );
234
 
235
+ //$WPAdminSettings = new WPAdminSettings( $args );
236
 
237
 
238
 
includes/functions-meta.php CHANGED
@@ -65,7 +65,7 @@ function settings_tabs_content_shortcode($tab, $post_id){
65
 
66
  );
67
 
68
- $settings_tabs_field->generate_field($args, $post_id);
69
  ?>
70
 
71
  <?php
@@ -142,7 +142,7 @@ function settings_tabs_content_shortcode($tab, $post_id){
142
 
143
  );
144
 
145
- $settings_tabs_field->generate_field($args, $post_id);
146
  ?>
147
 
148
 
@@ -167,6 +167,19 @@ function settings_tabs_content_options($tab, $post_id){
167
 
168
  $settings_tabs_field = new settings_tabs_field();
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  //var_dump($post_id);
171
 
172
  ?>
@@ -185,13 +198,15 @@ function settings_tabs_content_options($tab, $post_id){
185
  'title' => __('Collapsible','accordions'),
186
  'details' => __('Make accordion collapsible.','accordions'),
187
  'type' => 'select',
 
 
188
  'args' => array(
189
  'true' => __('True','accordions'),
190
  'false' => __('False','accordions'),
191
  ),
192
  );
193
 
194
- $settings_tabs_field->generate_field($args, $post_id);
195
  ?>
196
 
197
 
@@ -201,13 +216,15 @@ function settings_tabs_content_options($tab, $post_id){
201
  'title' => __('Keep expanded others','accordions'),
202
  'details' => __('This is useful when use collapsible.','accordions'),
203
  'type' => 'select',
 
 
204
  'args' => array(
205
  'no' => __('No','accordions'),
206
  'yes' => __('Yes','accordions'),
207
  ),
208
  );
209
 
210
- $settings_tabs_field->generate_field($args, $post_id);
211
  ?>
212
 
213
  <?php
@@ -216,6 +233,8 @@ function settings_tabs_content_options($tab, $post_id){
216
  'title' => __('Content height style','accordions'),
217
  'details' => __('accordion content style.','accordions'),
218
  'type' => 'select',
 
 
219
  'args' => array(
220
 
221
  'content' => __('Content','accordions'),
@@ -223,7 +242,7 @@ function settings_tabs_content_options($tab, $post_id){
223
  ),
224
  );
225
 
226
- $settings_tabs_field->generate_field($args, $post_id);
227
  ?>
228
 
229
 
@@ -235,6 +254,8 @@ function settings_tabs_content_options($tab, $post_id){
235
  'title' => __('Activate event','accordions'),
236
  'details' => __('Activate event type for header.','accordions'),
237
  'type' => 'select',
 
 
238
  'args' => array(
239
  'click' => __('Click','accordions'),
240
  'mouseover' => __('Mouseover','accordions'),
@@ -242,7 +263,7 @@ function settings_tabs_content_options($tab, $post_id){
242
  ),
243
  );
244
 
245
- $settings_tabs_field->generate_field($args, $post_id);
246
  ?>
247
 
248
  <?php
@@ -251,13 +272,15 @@ function settings_tabs_content_options($tab, $post_id){
251
  'title' => __('Enable lazy load','accordions'),
252
  'details' => __('Accordion content will be hidden until page load completed.','accordions'),
253
  'type' => 'select',
 
 
254
  'args' => array(
255
  'no' => __('No','accordions'),
256
  'yes' => __('Yes','accordions'),
257
  ),
258
  );
259
 
260
- $settings_tabs_field->generate_field($args, $post_id);
261
  ?>
262
 
263
  <?php
@@ -266,10 +289,12 @@ function settings_tabs_content_options($tab, $post_id){
266
  'title' => __('Lazy load image source','accordions'),
267
  'details' => __('You can set custom image source for lazy load icon.','accordions'),
268
  'type' => 'text',
 
 
269
  'placeholder' => '',
270
  );
271
 
272
- $settings_tabs_field->generate_field($args, $post_id);
273
  ?>
274
 
275
 
@@ -282,13 +307,15 @@ function settings_tabs_content_options($tab, $post_id){
282
  'title' => __('Hide edit link on front-end.','accordions'),
283
  'details' => __('You can display/hide accordion edit link on front-end','accordions'),
284
  'type' => 'select',
 
 
285
  'args' => array(
286
  'no' => __('No','accordions'),
287
  'yes' => __('Yes','accordions'),
288
  ),
289
  );
290
 
291
- $settings_tabs_field->generate_field($args, $post_id);
292
  ?>
293
 
294
 
@@ -307,13 +334,15 @@ function settings_tabs_content_options($tab, $post_id){
307
  'title' => __('Collapsible','accordions'),
308
  'details' => __('Make tabs collapsible.','accordions'),
309
  'type' => 'select',
 
 
310
  'args' => array(
311
  'true' => __('True','accordions'),
312
  'false' => __('False','accordions'),
313
  ),
314
  );
315
 
316
- $settings_tabs_field->generate_field($args, $post_id);
317
  ?>
318
 
319
  <?php
@@ -322,13 +351,15 @@ function settings_tabs_content_options($tab, $post_id){
322
  'title' => __('Activate event','accordions'),
323
  'details' => __('Event for activate tabs','accordions'),
324
  'type' => 'select',
 
 
325
  'args' => array(
326
  'click' => __('Click','accordions'),
327
  'mouseover' => __('Mouseover','accordions'),
328
  ),
329
  );
330
 
331
- $settings_tabs_field->generate_field($args, $post_id);
332
  ?>
333
 
334
 
@@ -363,6 +394,30 @@ function settings_tabs_content_style($tab, $post_id){
363
  $settings_tabs_field = new settings_tabs_field();
364
 
365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
 
367
 
368
 
@@ -385,11 +440,12 @@ function settings_tabs_content_style($tab, $post_id){
385
  'title' => __('Accordion themes','accordions'),
386
  'details' => __('You can choose accordion theme here.','accordions'),
387
  'type' => 'radio_image',
388
- 'default_value' => 'flat',
 
389
  'args' => $accordions_themes_list,
390
  );
391
 
392
- $settings_tabs_field->generate_field($args, $post_id);
393
  ?>
394
  </div>
395
 
@@ -406,11 +462,12 @@ function settings_tabs_content_style($tab, $post_id){
406
  'title' => __('Plus icon','accordions'),
407
  'details' => __('Icon for idle, you can use <a target="_blank" href="https://fontawesome.com/icons">Font Awesome</a> icons, just put the css class <code>fas fa-chevron-up</code>','accordions'),
408
  'type' => 'text_icon',
409
- 'default_value' => 'fas fa-chevron-up',
 
410
  'placeholder' => __('fas fa-chevron-up','accordions'),
411
  );
412
 
413
- $settings_tabs_field->generate_field($args, $post_id);
414
  ?>
415
 
416
 
@@ -420,11 +477,12 @@ function settings_tabs_content_style($tab, $post_id){
420
  'title' => __('Minus icon','accordions'),
421
  'details' => __('Icon for activate, you can use <a target="_blank" href="https://fontawesome.com/icons">Font Awesome</a> icons, just put the css class <code>fas fa-chevron-down</code>','accordions'),
422
  'type' => 'text_icon',
423
- 'default_value' => 'fas fa-chevron-down',
 
424
  'placeholder' => __('fas fa-chevron-down','accordions'),
425
  );
426
 
427
- $settings_tabs_field->generate_field($args, $post_id);
428
  ?>
429
 
430
 
@@ -434,10 +492,12 @@ function settings_tabs_content_style($tab, $post_id){
434
  'title' => __('Icons color','accordions'),
435
  'details' => __('Color for icons','accordions'),
436
  'type' => 'colorpicker',
437
- 'placeholder' => '',
 
 
438
  );
439
 
440
- $settings_tabs_field->generate_field($args, $post_id);
441
  ?>
442
 
443
  <?php
@@ -446,10 +506,12 @@ function settings_tabs_content_style($tab, $post_id){
446
  'title' => __('Icon hover color','accordions'),
447
  'details' => __('Color for icons on mousehover','accordions'),
448
  'type' => 'colorpicker',
449
- 'placeholder' => '',
 
 
450
  );
451
 
452
- $settings_tabs_field->generate_field($args, $post_id);
453
  ?>
454
 
455
  <?php
@@ -458,10 +520,12 @@ function settings_tabs_content_style($tab, $post_id){
458
  'title' => __('Icon font size','accordions'),
459
  'details' => __('You can set custom font size.','accordions'),
460
  'type' => 'text',
461
- 'placeholder' => '16px',
 
 
462
  );
463
 
464
- $settings_tabs_field->generate_field($args, $post_id);
465
  ?>
466
 
467
 
@@ -483,10 +547,12 @@ function settings_tabs_content_style($tab, $post_id){
483
  'title' => __('Default background color.','accordions'),
484
  'details' => __('Background color of header on idle','accordions'),
485
  'type' => 'colorpicker',
486
- 'placeholder' => '',
 
 
487
  );
488
 
489
- $settings_tabs_field->generate_field($args, $post_id);
490
  ?>
491
 
492
 
@@ -498,10 +564,12 @@ function settings_tabs_content_style($tab, $post_id){
498
  'title' => __('Active background color.','accordions'),
499
  'details' => __('Background color of header on active stats','accordions'),
500
  'type' => 'colorpicker',
501
- 'placeholder' => '',
 
 
502
  );
503
 
504
- $settings_tabs_field->generate_field($args, $post_id);
505
  ?>
506
 
507
 
@@ -511,10 +579,12 @@ function settings_tabs_content_style($tab, $post_id){
511
  'title' => __('Accordions header font color.','accordions'),
512
  'details' => __('Font color for accordion headers','accordions'),
513
  'type' => 'colorpicker',
514
- 'placeholder' => '',
 
 
515
  );
516
 
517
- $settings_tabs_field->generate_field($args, $post_id);
518
  ?>
519
 
520
 
@@ -524,10 +594,12 @@ function settings_tabs_content_style($tab, $post_id){
524
  'title' => __('Accordions header font color on hover.','accordions'),
525
  'details' => __('Font color for accordion headers','accordions'),
526
  'type' => 'colorpicker',
527
- 'placeholder' => '',
 
 
528
  );
529
 
530
- $settings_tabs_field->generate_field($args, $post_id);
531
  ?>
532
 
533
 
@@ -538,10 +610,12 @@ function settings_tabs_content_style($tab, $post_id){
538
  'title' => __('Accordions header font size.','accordions'),
539
  'details' => __('Choose font size for header text','accordions'),
540
  'type' => 'text',
541
- 'placeholder' => '',
 
 
542
  );
543
 
544
- $settings_tabs_field->generate_field($args, $post_id);
545
  ?>
546
 
547
  <?php
@@ -550,10 +624,12 @@ function settings_tabs_content_style($tab, $post_id){
550
  'title' => __('Accordions header padding.','accordions'),
551
  'details' => __('Choose header area padding','accordions'),
552
  'type' => 'text',
 
 
553
  'placeholder' => '10px',
554
  );
555
 
556
- $settings_tabs_field->generate_field($args, $post_id);
557
  ?>
558
 
559
  <?php
@@ -562,10 +638,12 @@ function settings_tabs_content_style($tab, $post_id){
562
  'title' => __('Accordions header margin.','accordions'),
563
  'details' => __('Choose header area margin','accordions'),
564
  'type' => 'text',
565
- 'placeholder' => '',
 
 
566
  );
567
 
568
- $settings_tabs_field->generate_field($args, $post_id);
569
  ?>
570
 
571
 
@@ -587,10 +665,12 @@ function settings_tabs_content_style($tab, $post_id){
587
  'title' => __('Accordions content font color.','accordions'),
588
  'details' => __('You can choose custom color for accordion content','accordions'),
589
  'type' => 'colorpicker',
590
- 'placeholder' => '',
 
 
591
  );
592
 
593
- $settings_tabs_field->generate_field($args, $post_id);
594
  ?>
595
 
596
 
@@ -600,10 +680,12 @@ function settings_tabs_content_style($tab, $post_id){
600
  'title' => __('Accordions content font size.','accordions'),
601
  'details' => __('You can set custom font size for accordion content','accordions'),
602
  'type' => 'text',
603
- 'placeholder' => '',
 
 
604
  );
605
 
606
- $settings_tabs_field->generate_field($args, $post_id);
607
  ?>
608
 
609
  <?php
@@ -612,10 +694,12 @@ function settings_tabs_content_style($tab, $post_id){
612
  'title' => __('Accordions content background color.','accordions'),
613
  'details' => __('You can choose custom background color for accordion content area','accordions'),
614
  'type' => 'colorpicker',
615
- 'placeholder' => '',
 
 
616
  );
617
 
618
- $settings_tabs_field->generate_field($args, $post_id);
619
  ?>
620
 
621
 
@@ -625,10 +709,12 @@ function settings_tabs_content_style($tab, $post_id){
625
  'title' => __('Accordions content padding.','accordions'),
626
  'details' => __('You can set custom padding for accordion content','accordions'),
627
  'type' => 'text',
628
- 'placeholder' => '',
 
 
629
  );
630
 
631
- $settings_tabs_field->generate_field($args, $post_id);
632
  ?>
633
 
634
 
@@ -638,10 +724,12 @@ function settings_tabs_content_style($tab, $post_id){
638
  'title' => __('Accordions content margin.','accordions'),
639
  'details' => __('You can set custom margin for accordion content','accordions'),
640
  'type' => 'text',
641
- 'placeholder' => '',
 
 
642
  );
643
 
644
- $settings_tabs_field->generate_field($args, $post_id);
645
  ?>
646
 
647
 
@@ -669,11 +757,13 @@ function settings_tabs_content_style($tab, $post_id){
669
  'title' => __('Container padding.','accordions'),
670
  'details' => __('Set container padding','accordions'),
671
  'type' => 'text',
 
 
672
  'placeholder' => '10px',
673
 
674
  );
675
 
676
- $settings_tabs_field->generate_field($args, $post_id);
677
  ?>
678
 
679
 
@@ -683,11 +773,13 @@ function settings_tabs_content_style($tab, $post_id){
683
  'title' => __('Container background color.','accordions'),
684
  'details' => __('Set container background color','accordions'),
685
  'type' => 'colorpicker',
 
 
686
  'placeholder' => '',
687
 
688
  );
689
 
690
- $settings_tabs_field->generate_field($args, $post_id);
691
  ?>
692
 
693
  <?php
@@ -696,6 +788,8 @@ function settings_tabs_content_style($tab, $post_id){
696
  'title' => __('Container text align.','accordions'),
697
  'details' => __('Set container text align','accordions'),
698
  'type' => 'select',
 
 
699
  'args' => array(
700
  'left' => __('Left','accordions'),
701
  'right' => __('Right','accordions'),
@@ -706,7 +800,7 @@ function settings_tabs_content_style($tab, $post_id){
706
 
707
  );
708
 
709
- $settings_tabs_field->generate_field($args, $post_id);
710
  ?>
711
 
712
  <?php
@@ -715,11 +809,13 @@ function settings_tabs_content_style($tab, $post_id){
715
  'title' => __('Container background image.','accordions'),
716
  'details' => __('Set container background image','accordions'),
717
  'type' => 'text',
 
 
718
  'placeholder' => '',
719
 
720
  );
721
 
722
- $settings_tabs_field->generate_field($args, $post_id);
723
  ?>
724
 
725
 
@@ -750,6 +846,10 @@ function settings_tabs_content_content($tab, $post_id){
750
 
751
  $settings_tabs_field = new settings_tabs_field();
752
 
 
 
 
 
753
 
754
  ?>
755
  <div class="section">
@@ -757,47 +857,12 @@ function settings_tabs_content_content($tab, $post_id){
757
  <p class="description section-description"><?php echo __('Add you accordion content here.','accordions'); ?></p>
758
 
759
  <?php
760
- $args = array(
761
- 'id' => 'accordions_items_content_margin',
762
- 'title' => __('Accordions Content.','accordions'),
763
- 'details' => __('accordion content','accordions'),
764
- 'type' => 'accordion_content',
765
 
766
- );
767
 
768
- $settings_tabs_field->generate_field($args, $post_id);
769
  ?>
770
 
771
 
772
- </div>
773
- <?php
774
- }
775
-
776
-
777
- add_action('settings_tabs_field_accordion_content', 'settings_tabs_field_accordion_content', 10, 2);
778
- function settings_tabs_field_accordion_content($option, $post_id){
779
-
780
- $id = isset( $option['id'] ) ? $option['id'] : "";
781
- $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
782
- $value = get_option( $id );
783
-
784
- $title = isset( $option['title'] ) ? $option['title'] : "";
785
- $details = isset( $option['details'] ) ? $option['details'] : "";
786
-
787
-
788
-
789
- $accordions_content_title = get_post_meta($post_id,'accordions_content_title', true);
790
- $accordions_content_body = get_post_meta($post_id,'accordions_content_body', true);
791
-
792
- $accordions_hide = get_post_meta($post_id,'accordions_hide', true);
793
-
794
-
795
-
796
-
797
- ?>
798
- <div class="setting-field">
799
- <div class="field-lable"><?php if(!empty($title)) echo $title; ?></div>
800
- <div class="field-input">
801
 
802
  <div class="accordions-content-buttons" >
803
  <div class="button add-accordions"><?php _e('Add', 'accordions'); ?></div>
@@ -818,66 +883,67 @@ function settings_tabs_field_accordion_content($option, $post_id){
818
 
819
 
820
  if(!empty($accordions_content_title)):
821
- foreach ($accordions_content_title as $accordions_key => $accordions_title){
822
 
823
- ?>
824
 
825
- <div class="items">
826
 
827
- <div class="section-header">
828
 
829
- <span class="move"><i class="fa fa-bars"></i></span>
830
- <span class="expand-compress"><i class="fa fa-expand"></i><i class="fa fa-compress"></i></span>
 
831
 
832
- <div class="accordions-title-preview">
833
- <?php if(!empty($accordions_title)) echo $accordions_title; ?>
834
- </div>
835
 
836
- <span class="removeaccordions"><?php _e('Remove', 'accordions'); ?></span>
837
 
838
- <?php
839
 
840
- if(!empty($accordions_hide[$accordions_key]))
841
- {
842
- $checked = 'checked';
843
- }
844
- else
845
- {
846
- $checked = '';
847
- }
848
 
 
 
 
 
 
 
 
 
849
 
850
- ?>
851
 
852
- <label><input type="checkbox" name="accordions_hide[<?php echo $accordions_key; ?>]" value="1" <?php echo $checked; ?> /><?php _e('Hide on Frontend', 'accordions'); ?></label>
853
 
 
854
 
855
- </div>
856
- <div class="section-panel">
857
 
858
- <strong><?php _e('Header text', 'accordions'); ?></strong> <br>
859
- <input class="accordions_content_title" style="width:80%" placeholder="<?php echo __('Accordion header text', 'accordions'); ?>" type="text" name="accordions_content_title[<?php echo $accordions_key; ?>]" value="<?php if(!empty($accordions_title)) echo esc_attr($accordions_title); //htmlentities ?>" /><br><br>
860
- <strong><?php _e('Content', 'accordions'); ?></strong> <br>
861
- <?php
862
 
863
- wp_editor( $accordions_content_body[$accordions_key], 'accordions_content_body'.$accordions_key, $settings = array('textarea_name'=>'accordions_content_body['.$accordions_key.']') );
 
 
 
864
 
 
865
 
866
- ?>
867
- </div>
 
868
 
869
 
870
 
871
- </div>
872
- <?php
873
 
874
- $i++;
875
- }
876
 
877
  else:
878
  ?>
879
  <div class="items"><?php echo __('Click "Add" button to add your accordion content', 'accordions'); ?></div>
880
- <?php
881
 
882
  endif;
883
 
@@ -893,7 +959,7 @@ function settings_tabs_field_accordion_content($option, $post_id){
893
  });
894
  $(document).on('click', '.accordions-content-buttons .add-accordions', function(){
895
  var unique_key = $.now();
896
- $("#accordions_metabox .accordions-content").append('<div class="items" valign="top"><div class="section-header"><span class="move"><i class="fa fa-bars"></i></span><span class="expand-compress"><i class="fa fa-expand"></i><i class="fa fa-compress"></i></span><div class="accordions-title-preview">Demo Title #'+unique_key+'</div><span class="removeaccordions">Remove</span><label class="switch"><input type="checkbox" value="1" name="accordions_hide['+unique_key+']">Hide on Frontend</label></div><div class="section-panel"><strong><?php _e('Header text','accordions'); ?></strong> <br><input style="width:80%" placeholder="<?php echo __('Accordion header text', 'accordions'); ?>" type="text" name="accordions_content_title['+unique_key+']" value="" /><br> <br><strong><?php _e('Content', 'accordions'); ?></strong> <br><textarea class="accordion-content-textarea" id="content-'+unique_key+'" placeholder="Accordion content" name="accordions_content_body['+unique_key+']" ></textarea></div></div>');
897
  wp.editor.initialize( 'content-'+unique_key, {
898
  mediaButtons: true,
899
  tinymce: {
@@ -907,8 +973,52 @@ function settings_tabs_field_accordion_content($option, $post_id){
907
 
908
 
909
 
910
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
911
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
912
 
913
 
914
  <?php
@@ -947,9 +1057,10 @@ function settings_tabs_content_stats($tab, $post_id){
947
  'details' => '',
948
  'type' => 'accordions_stats',
949
 
 
950
  );
951
 
952
- $settings_tabs_field->generate_field($args, $post_id);
953
  ?>
954
 
955
 
@@ -1047,6 +1158,8 @@ function settings_tabs_content_custom_scripts($tab, $post_id){
1047
 
1048
  $settings_tabs_field = new settings_tabs_field();
1049
 
 
 
1050
 
1051
  ?>
1052
  <div class="section">
@@ -1063,12 +1176,13 @@ function settings_tabs_content_custom_scripts($tab, $post_id){
1063
  'title' => __('Custom Js.','accordions'),
1064
  'details' => __('You can add custom scripts here, do not use <code>&lt;script&gt; &lt;/script&gt;</code> tag','accordions'),
1065
  'type' => 'scripts_js',
1066
- 'default_value' => '',
 
1067
 
1068
 
1069
  );
1070
 
1071
- $settings_tabs_field->generate_field($args, $post_id);
1072
  ?>
1073
 
1074
  <?php
@@ -1077,10 +1191,12 @@ function settings_tabs_content_custom_scripts($tab, $post_id){
1077
  'title' => __('Custom CSS.','accordions'),
1078
  'details' => __('You can add custom css here, do not use <code> &lt;style&gt; &lt;/style&gt;</code> tag','accordions'),
1079
  'type' => 'scripts_css',
 
 
1080
 
1081
  );
1082
 
1083
- $settings_tabs_field->generate_field($args, $post_id);
1084
  ?>
1085
 
1086
  </div>
65
 
66
  );
67
 
68
+ $settings_tabs_field->generate_field($args);
69
  ?>
70
 
71
  <?php
142
 
143
  );
144
 
145
+ $settings_tabs_field->generate_field($args);
146
  ?>
147
 
148
 
167
 
168
  $settings_tabs_field = new settings_tabs_field();
169
 
170
+ $accordions_collapsible = get_post_meta( $post_id, 'accordions_collapsible', true );
171
+ $accordions_expaned_other = get_post_meta( $post_id, 'accordions_expaned_other', true );
172
+ $accordions_heightStyle = get_post_meta( $post_id, 'accordions_heightStyle', true );
173
+ $accordions_active_event = get_post_meta( $post_id, 'accordions_active_event', true );
174
+ $accordions_lazy_load = get_post_meta( $post_id, 'accordions_lazy_load', true );
175
+ $accordions_lazy_load_src = get_post_meta( $post_id, 'accordions_lazy_load_src', true );
176
+ $accordions_hide_edit = get_post_meta( $post_id, 'accordions_hide_edit', true );
177
+ $accordions_tabs_collapsible = get_post_meta( $post_id, 'accordions_tabs_collapsible', true );
178
+ $accordions_tabs_active_event = get_post_meta( $post_id, 'accordions_tabs_active_event', true );
179
+
180
+
181
+
182
+
183
  //var_dump($post_id);
184
 
185
  ?>
198
  'title' => __('Collapsible','accordions'),
199
  'details' => __('Make accordion collapsible.','accordions'),
200
  'type' => 'select',
201
+ 'value' => $accordions_collapsible,
202
+ 'default' => 'true',
203
  'args' => array(
204
  'true' => __('True','accordions'),
205
  'false' => __('False','accordions'),
206
  ),
207
  );
208
 
209
+ $settings_tabs_field->generate_field($args);
210
  ?>
211
 
212
 
216
  'title' => __('Keep expanded others','accordions'),
217
  'details' => __('This is useful when use collapsible.','accordions'),
218
  'type' => 'select',
219
+ 'value' => $accordions_expaned_other,
220
+ 'default' => 'no',
221
  'args' => array(
222
  'no' => __('No','accordions'),
223
  'yes' => __('Yes','accordions'),
224
  ),
225
  );
226
 
227
+ $settings_tabs_field->generate_field($args);
228
  ?>
229
 
230
  <?php
233
  'title' => __('Content height style','accordions'),
234
  'details' => __('accordion content style.','accordions'),
235
  'type' => 'select',
236
+ 'value' => $accordions_heightStyle,
237
+ 'default' => 'content',
238
  'args' => array(
239
 
240
  'content' => __('Content','accordions'),
242
  ),
243
  );
244
 
245
+ $settings_tabs_field->generate_field($args);
246
  ?>
247
 
248
 
254
  'title' => __('Activate event','accordions'),
255
  'details' => __('Activate event type for header.','accordions'),
256
  'type' => 'select',
257
+ 'value' => $accordions_active_event,
258
+ 'default' => 'click',
259
  'args' => array(
260
  'click' => __('Click','accordions'),
261
  'mouseover' => __('Mouseover','accordions'),
263
  ),
264
  );
265
 
266
+ $settings_tabs_field->generate_field($args);
267
  ?>
268
 
269
  <?php
272
  'title' => __('Enable lazy load','accordions'),
273
  'details' => __('Accordion content will be hidden until page load completed.','accordions'),
274
  'type' => 'select',
275
+ 'value' => $accordions_lazy_load,
276
+ 'default' => 'yes',
277
  'args' => array(
278
  'no' => __('No','accordions'),
279
  'yes' => __('Yes','accordions'),
280
  ),
281
  );
282
 
283
+ $settings_tabs_field->generate_field($args);
284
  ?>
285
 
286
  <?php
289
  'title' => __('Lazy load image source','accordions'),
290
  'details' => __('You can set custom image source for lazy load icon.','accordions'),
291
  'type' => 'text',
292
+ 'value' => $accordions_lazy_load_src,
293
+ 'default' => '',
294
  'placeholder' => '',
295
  );
296
 
297
+ $settings_tabs_field->generate_field($args);
298
  ?>
299
 
300
 
307
  'title' => __('Hide edit link on front-end.','accordions'),
308
  'details' => __('You can display/hide accordion edit link on front-end','accordions'),
309
  'type' => 'select',
310
+ 'value' => $accordions_hide_edit,
311
+ 'default' => 'yes',
312
  'args' => array(
313
  'no' => __('No','accordions'),
314
  'yes' => __('Yes','accordions'),
315
  ),
316
  );
317
 
318
+ $settings_tabs_field->generate_field($args);
319
  ?>
320
 
321
 
334
  'title' => __('Collapsible','accordions'),
335
  'details' => __('Make tabs collapsible.','accordions'),
336
  'type' => 'select',
337
+ 'value' => $accordions_tabs_collapsible,
338
+ 'default' => 'true',
339
  'args' => array(
340
  'true' => __('True','accordions'),
341
  'false' => __('False','accordions'),
342
  ),
343
  );
344
 
345
+ $settings_tabs_field->generate_field($args);
346
  ?>
347
 
348
  <?php
351
  'title' => __('Activate event','accordions'),
352
  'details' => __('Event for activate tabs','accordions'),
353
  'type' => 'select',
354
+ 'value' => $accordions_tabs_active_event,
355
+ 'default' => 'click',
356
  'args' => array(
357
  'click' => __('Click','accordions'),
358
  'mouseover' => __('Mouseover','accordions'),
359
  ),
360
  );
361
 
362
+ $settings_tabs_field->generate_field($args);
363
  ?>
364
 
365
 
394
  $settings_tabs_field = new settings_tabs_field();
395
 
396
 
397
+ $accordions_themes = get_post_meta( $post_id, 'accordions_themes', true );
398
+ $accordions_icons_plus = get_post_meta( $post_id, 'accordions_icons_plus', true );
399
+ $accordions_icons_minus = get_post_meta( $post_id, 'accordions_icons_minus', true );
400
+ $accordions_icons_color = get_post_meta( $post_id, 'accordions_icons_color', true );
401
+ $accordions_icons_color_hover = get_post_meta( $post_id, 'accordions_icons_color_hover', true );
402
+ $accordions_icons_font_size = get_post_meta( $post_id, 'accordions_icons_font_size', true );
403
+ $accordions_default_bg_color = get_post_meta( $post_id, 'accordions_default_bg_color', true );
404
+ $accordions_active_bg_color = get_post_meta( $post_id, 'accordions_active_bg_color', true );
405
+ $accordions_items_title_color = get_post_meta( $post_id, 'accordions_items_title_color', true );
406
+ $accordions_items_title_color_hover = get_post_meta( $post_id, 'accordions_items_title_color_hover', true );
407
+ $accordions_items_title_font_size = get_post_meta( $post_id, 'accordions_items_title_font_size', true );
408
+ $accordions_items_title_padding = get_post_meta( $post_id, 'accordions_items_title_padding', true );
409
+ $accordions_items_title_margin = get_post_meta( $post_id, 'accordions_items_title_margin', true );
410
+ $accordions_items_content_color = get_post_meta( $post_id, 'accordions_items_content_color', true );
411
+ $accordions_items_content_font_size = get_post_meta( $post_id, 'accordions_items_content_font_size', true );
412
+
413
+
414
+ $accordions_items_content_bg_color = get_post_meta( $post_id, 'accordions_items_content_bg_color', true );
415
+ $accordions_items_content_padding = get_post_meta( $post_id, 'accordions_items_content_padding', true );
416
+ $accordions_items_content_margin = get_post_meta( $post_id, 'accordions_items_content_margin', true );
417
+ $accordions_container_padding = get_post_meta( $post_id, 'accordions_container_padding', true );
418
+ $accordions_container_text_align = get_post_meta( $post_id, 'accordions_container_text_align', true );
419
+ $accordions_container_bg_color = get_post_meta( $post_id, 'accordions_container_bg_color', true );
420
+ $accordions_bg_img = get_post_meta( $post_id, 'accordions_bg_img', true );
421
 
422
 
423
 
440
  'title' => __('Accordion themes','accordions'),
441
  'details' => __('You can choose accordion theme here.','accordions'),
442
  'type' => 'radio_image',
443
+ 'default' => 'flat',
444
+ 'value' => $accordions_themes,
445
  'args' => $accordions_themes_list,
446
  );
447
 
448
+ $settings_tabs_field->generate_field($args);
449
  ?>
450
  </div>
451
 
462
  'title' => __('Plus icon','accordions'),
463
  'details' => __('Icon for idle, you can use <a target="_blank" href="https://fontawesome.com/icons">Font Awesome</a> icons, just put the css class <code>fas fa-chevron-up</code>','accordions'),
464
  'type' => 'text_icon',
465
+ 'value' => $accordions_icons_plus,
466
+ 'default' => 'fas fa-chevron-up',
467
  'placeholder' => __('fas fa-chevron-up','accordions'),
468
  );
469
 
470
+ $settings_tabs_field->generate_field($args);
471
  ?>
472
 
473
 
477
  'title' => __('Minus icon','accordions'),
478
  'details' => __('Icon for activate, you can use <a target="_blank" href="https://fontawesome.com/icons">Font Awesome</a> icons, just put the css class <code>fas fa-chevron-down</code>','accordions'),
479
  'type' => 'text_icon',
480
+ 'value' => $accordions_icons_minus,
481
+ 'default' => 'fas fa-chevron-down',
482
  'placeholder' => __('fas fa-chevron-down','accordions'),
483
  );
484
 
485
+ $settings_tabs_field->generate_field($args);
486
  ?>
487
 
488
 
492
  'title' => __('Icons color','accordions'),
493
  'details' => __('Color for icons','accordions'),
494
  'type' => 'colorpicker',
495
+ 'value' => $accordions_icons_color,
496
+ 'default' => '',
497
+ 'placeholder' => '#999999',
498
  );
499
 
500
+ $settings_tabs_field->generate_field($args);
501
  ?>
502
 
503
  <?php
506
  'title' => __('Icon hover color','accordions'),
507
  'details' => __('Color for icons on mousehover','accordions'),
508
  'type' => 'colorpicker',
509
+ 'value' => $accordions_icons_color_hover,
510
+ 'default' => '',
511
+ 'placeholder' => '#777777',
512
  );
513
 
514
+ $settings_tabs_field->generate_field($args);
515
  ?>
516
 
517
  <?php
520
  'title' => __('Icon font size','accordions'),
521
  'details' => __('You can set custom font size.','accordions'),
522
  'type' => 'text',
523
+ 'value' => $accordions_icons_font_size,
524
+ 'default' => '',
525
+ 'placeholder' => '14px',
526
  );
527
 
528
+ $settings_tabs_field->generate_field($args);
529
  ?>
530
 
531
 
547
  'title' => __('Default background color.','accordions'),
548
  'details' => __('Background color of header on idle','accordions'),
549
  'type' => 'colorpicker',
550
+ 'value' => $accordions_default_bg_color,
551
+ 'default' => '',
552
+ 'placeholder' => '#eeeeee',
553
  );
554
 
555
+ $settings_tabs_field->generate_field($args);
556
  ?>
557
 
558
 
564
  'title' => __('Active background color.','accordions'),
565
  'details' => __('Background color of header on active stats','accordions'),
566
  'type' => 'colorpicker',
567
+ 'value' => $accordions_active_bg_color,
568
+ 'default' => '',
569
+ 'placeholder' => '#dddddd',
570
  );
571
 
572
+ $settings_tabs_field->generate_field($args);
573
  ?>
574
 
575
 
579
  'title' => __('Accordions header font color.','accordions'),
580
  'details' => __('Font color for accordion headers','accordions'),
581
  'type' => 'colorpicker',
582
+ 'value' => $accordions_items_title_color,
583
+ 'default' => '',
584
+ 'placeholder' => '#999999',
585
  );
586
 
587
+ $settings_tabs_field->generate_field($args);
588
  ?>
589
 
590
 
594
  'title' => __('Accordions header font color on hover.','accordions'),
595
  'details' => __('Font color for accordion headers','accordions'),
596
  'type' => 'colorpicker',
597
+ 'value' => $accordions_items_title_color_hover,
598
+ 'default' => '',
599
+ 'placeholder' => '#7777777',
600
  );
601
 
602
+ $settings_tabs_field->generate_field($args);
603
  ?>
604
 
605
 
610
  'title' => __('Accordions header font size.','accordions'),
611
  'details' => __('Choose font size for header text','accordions'),
612
  'type' => 'text',
613
+ 'value' => $accordions_items_title_font_size,
614
+ 'default' => '',
615
+ 'placeholder' => '14px',
616
  );
617
 
618
+ $settings_tabs_field->generate_field($args);
619
  ?>
620
 
621
  <?php
624
  'title' => __('Accordions header padding.','accordions'),
625
  'details' => __('Choose header area padding','accordions'),
626
  'type' => 'text',
627
+ 'value' => $accordions_items_title_padding,
628
+ 'default' => '',
629
  'placeholder' => '10px',
630
  );
631
 
632
+ $settings_tabs_field->generate_field($args);
633
  ?>
634
 
635
  <?php
638
  'title' => __('Accordions header margin.','accordions'),
639
  'details' => __('Choose header area margin','accordions'),
640
  'type' => 'text',
641
+ 'value' => $accordions_items_title_margin,
642
+ 'default' => '',
643
+ 'placeholder' => '5px',
644
  );
645
 
646
+ $settings_tabs_field->generate_field($args);
647
  ?>
648
 
649
 
665
  'title' => __('Accordions content font color.','accordions'),
666
  'details' => __('You can choose custom color for accordion content','accordions'),
667
  'type' => 'colorpicker',
668
+ 'value' => $accordions_items_content_color,
669
+ 'default' => '',
670
+ 'placeholder' => '#999999',
671
  );
672
 
673
+ $settings_tabs_field->generate_field($args);
674
  ?>
675
 
676
 
680
  'title' => __('Accordions content font size.','accordions'),
681
  'details' => __('You can set custom font size for accordion content','accordions'),
682
  'type' => 'text',
683
+ 'value' => $accordions_items_content_font_size,
684
+ 'default' => '',
685
+ 'placeholder' => '10px',
686
  );
687
 
688
+ $settings_tabs_field->generate_field($args);
689
  ?>
690
 
691
  <?php
694
  'title' => __('Accordions content background color.','accordions'),
695
  'details' => __('You can choose custom background color for accordion content area','accordions'),
696
  'type' => 'colorpicker',
697
+ 'value' => $accordions_items_content_bg_color,
698
+ 'default' => '#ffffff',
699
+ 'placeholder' => '#ffffff',
700
  );
701
 
702
+ $settings_tabs_field->generate_field($args);
703
  ?>
704
 
705
 
709
  'title' => __('Accordions content padding.','accordions'),
710
  'details' => __('You can set custom padding for accordion content','accordions'),
711
  'type' => 'text',
712
+ 'value' => $accordions_items_content_padding,
713
+ 'default' => '',
714
+ 'placeholder' => '10px',
715
  );
716
 
717
+ $settings_tabs_field->generate_field($args);
718
  ?>
719
 
720
 
724
  'title' => __('Accordions content margin.','accordions'),
725
  'details' => __('You can set custom margin for accordion content','accordions'),
726
  'type' => 'text',
727
+ 'value' => $accordions_items_content_margin,
728
+ 'default' => '',
729
+ 'placeholder' => '10px',
730
  );
731
 
732
+ $settings_tabs_field->generate_field($args);
733
  ?>
734
 
735
 
757
  'title' => __('Container padding.','accordions'),
758
  'details' => __('Set container padding','accordions'),
759
  'type' => 'text',
760
+ 'value' => $accordions_container_padding,
761
+ 'default' => '',
762
  'placeholder' => '10px',
763
 
764
  );
765
 
766
+ $settings_tabs_field->generate_field($args);
767
  ?>
768
 
769
 
773
  'title' => __('Container background color.','accordions'),
774
  'details' => __('Set container background color','accordions'),
775
  'type' => 'colorpicker',
776
+ 'value' => $accordions_container_bg_color,
777
+ 'default' => '#ffffff',
778
  'placeholder' => '',
779
 
780
  );
781
 
782
+ $settings_tabs_field->generate_field($args);
783
  ?>
784
 
785
  <?php
788
  'title' => __('Container text align.','accordions'),
789
  'details' => __('Set container text align','accordions'),
790
  'type' => 'select',
791
+ 'value' => $accordions_container_text_align,
792
+ 'default' => 'left',
793
  'args' => array(
794
  'left' => __('Left','accordions'),
795
  'right' => __('Right','accordions'),
800
 
801
  );
802
 
803
+ $settings_tabs_field->generate_field($args);
804
  ?>
805
 
806
  <?php
809
  'title' => __('Container background image.','accordions'),
810
  'details' => __('Set container background image','accordions'),
811
  'type' => 'text',
812
+ 'value' => $accordions_bg_img,
813
+ 'default' => '',
814
  'placeholder' => '',
815
 
816
  );
817
 
818
+ $settings_tabs_field->generate_field($args);
819
  ?>
820
 
821
 
846
 
847
  $settings_tabs_field = new settings_tabs_field();
848
 
849
+ $accordions_content_title = get_post_meta($post_id,'accordions_content_title', true);
850
+ $accordions_content_body = get_post_meta($post_id,'accordions_content_body', true);
851
+ $accordions_hide = get_post_meta($post_id,'accordions_hide', true);
852
+
853
 
854
  ?>
855
  <div class="section">
857
  <p class="description section-description"><?php echo __('Add you accordion content here.','accordions'); ?></p>
858
 
859
  <?php
 
 
 
 
 
860
 
861
+ ob_start();
862
 
 
863
  ?>
864
 
865
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
866
 
867
  <div class="accordions-content-buttons" >
868
  <div class="button add-accordions"><?php _e('Add', 'accordions'); ?></div>
883
 
884
 
885
  if(!empty($accordions_content_title)):
886
+ foreach ($accordions_content_title as $accordions_key => $accordions_title){
887
 
888
+ ?>
889
 
890
+ <div class="item">
891
 
892
+ <div class="header">
893
 
894
+ <span class="remove"><i class="fa fa-times"></i></span>
895
+ <span class="move"><i class="fas fa-sort"></i></span>
896
+ <span class="expand"><i class="fa fa-expand"></i><i class="fa fa-compress"></i></span>
897
 
898
+ <div class="accordions-title-preview">
899
+ <?php if(!empty($accordions_title)) echo $accordions_title; ?>
900
+ </div>
901
 
 
902
 
 
903
 
904
+ <?php
 
 
 
 
 
 
 
905
 
906
+ if(!empty($accordions_hide[$accordions_key]))
907
+ {
908
+ $checked = 'checked';
909
+ }
910
+ else
911
+ {
912
+ $checked = '';
913
+ }
914
 
 
915
 
916
+ ?>
917
 
918
+ <label class="float-right"><input type="checkbox" name="accordions_hide[<?php echo $accordions_key; ?>]" value="1" <?php echo $checked; ?> /><?php _e('Hide on Frontend', 'accordions'); ?></label>
919
 
 
 
920
 
921
+ </div>
922
+ <div class="options">
 
 
923
 
924
+ <strong><?php _e('Header text', 'accordions'); ?></strong> <br>
925
+ <input class="accordions_content_title" style="width:80%" placeholder="<?php echo __('Accordion header text', 'accordions'); ?>" type="text" name="accordions_content_title[<?php echo $accordions_key; ?>]" value="<?php if(!empty($accordions_title)) echo esc_attr($accordions_title); //htmlentities ?>" /><br><br>
926
+ <strong><?php _e('Content', 'accordions'); ?></strong> <br>
927
+ <?php
928
 
929
+ wp_editor( $accordions_content_body[$accordions_key], 'accordions_content_body'.$accordions_key, $settings = array('textarea_name'=>'accordions_content_body['.$accordions_key.']') );
930
 
931
+
932
+ ?>
933
+ </div>
934
 
935
 
936
 
937
+ </div>
938
+ <?php
939
 
940
+ $i++;
941
+ }
942
 
943
  else:
944
  ?>
945
  <div class="items"><?php echo __('Click "Add" button to add your accordion content', 'accordions'); ?></div>
946
+ <?php
947
 
948
  endif;
949
 
959
  });
960
  $(document).on('click', '.accordions-content-buttons .add-accordions', function(){
961
  var unique_key = $.now();
962
+ $("#accordions_metabox .accordions-content").append('<div class="item" valign="top"><div class="header"><span class="remove"><i class="fa fa-times"></i></span><span class="move"><i class="fas fa-sort"></i></span><span class="expand"><i class="fa fa-expand"></i><i class="fa fa-compress"></i></span><div class="accordions-title-preview">Demo Title #'+unique_key+'</div><label class="float-left"><input type="checkbox" value="1" name="accordions_hide['+unique_key+']">Hide on Frontend</label></div><div class="options"><strong><?php _e('Header text','accordions'); ?></strong> <br><input style="width:80%" placeholder="<?php echo __('Accordion header text', 'accordions'); ?>" type="text" name="accordions_content_title['+unique_key+']" value="" /><br> <br><strong><?php _e('Content', 'accordions'); ?></strong> <br><textarea class="accordion-content-textarea" id="content-'+unique_key+'" placeholder="Accordion content" name="accordions_content_body['+unique_key+']" ></textarea></div></div>');
963
  wp.editor.initialize( 'content-'+unique_key, {
964
  mediaButtons: true,
965
  tinymce: {
973
 
974
 
975
 
976
+
977
+
978
+ <?php
979
+
980
+ $html = ob_get_clean();
981
+ $args = array(
982
+ 'id' => 'accordions_items_content',
983
+ 'title' => __('Accordion content','accordions'),
984
+ 'details' => '',
985
+ 'type' => 'custom_html',
986
+ 'html' => $html,
987
+ );
988
+
989
+ $settings_tabs_field->generate_field($args);
990
+
991
+
992
+ ?>
993
+
994
+
995
  </div>
996
+ <?php
997
+ }
998
+
999
+
1000
+ //add_action('settings_tabs_field_accordion_content', 'settings_tabs_field_accordion_content', 10, 2);
1001
+ function settings_tabs_field_accordion_content($option, $post_id){
1002
+
1003
+ $id = isset( $option['id'] ) ? $option['id'] : "";
1004
+ $placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
1005
+ $value = get_option( $id );
1006
+
1007
+ $title = isset( $option['title'] ) ? $option['title'] : "";
1008
+ $details = isset( $option['details'] ) ? $option['details'] : "";
1009
+
1010
+
1011
+
1012
+ $accordions_content_title = get_post_meta($post_id,'accordions_content_title', true);
1013
+ $accordions_content_body = get_post_meta($post_id,'accordions_content_body', true);
1014
+
1015
+ $accordions_hide = get_post_meta($post_id,'accordions_hide', true);
1016
+
1017
+
1018
+
1019
+
1020
+ ?>
1021
+
1022
 
1023
 
1024
  <?php
1057
  'details' => '',
1058
  'type' => 'accordions_stats',
1059
 
1060
+
1061
  );
1062
 
1063
+ $settings_tabs_field->generate_field($args);
1064
  ?>
1065
 
1066
 
1158
 
1159
  $settings_tabs_field = new settings_tabs_field();
1160
 
1161
+ $accordions_custom_js = get_post_meta( $post_id, 'accordions_custom_js', true );
1162
+ $accordions_custom_css = get_post_meta( $post_id, 'accordions_custom_css', true );
1163
 
1164
  ?>
1165
  <div class="section">
1176
  'title' => __('Custom Js.','accordions'),
1177
  'details' => __('You can add custom scripts here, do not use <code>&lt;script&gt; &lt;/script&gt;</code> tag','accordions'),
1178
  'type' => 'scripts_js',
1179
+ 'value' => $accordions_custom_js,
1180
+ 'default' => '',
1181
 
1182
 
1183
  );
1184
 
1185
+ $settings_tabs_field->generate_field($args);
1186
  ?>
1187
 
1188
  <?php
1191
  'title' => __('Custom CSS.','accordions'),
1192
  'details' => __('You can add custom css here, do not use <code> &lt;style&gt; &lt;/style&gt;</code> tag','accordions'),
1193
  'type' => 'scripts_css',
1194
+ 'value' => $accordions_custom_css,
1195
+ 'default' => '',
1196
 
1197
  );
1198
 
1199
+ $settings_tabs_field->generate_field($args);
1200
  ?>
1201
 
1202
  </div>
includes/meta-new.php CHANGED
@@ -56,8 +56,10 @@ function meta_boxes_accordions(){
56
 
57
  $screens = array( 'accordions' );
58
  foreach ( $screens as $screen ){
59
- add_meta_box('accordions_metabox',__( 'Accordions Options', 'accordions' ),'meta_boxes_accordions_input', $screen);
60
- }
 
 
61
 
62
  add_meta_box('accordions_product_metabox',__( 'Product FAQ Tab', 'accordions' ),'meta_boxes_accordions_product_input', 'product', 'side', 'high');
63
 
@@ -558,3 +560,92 @@ add_action( 'save_post', 'meta_boxes_accordions_product_save' );
558
 
559
 
560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  $screens = array( 'accordions' );
58
  foreach ( $screens as $screen ){
59
+ add_meta_box('accordions_metabox',__( 'Accordions Options', 'accordions' ),'meta_boxes_accordions_input', $screen);
60
+ add_meta_box('accordions_side_metabox',__( 'Accordions Info', 'accordions' ),'meta_boxes_accordions_side', $screen,'side');
61
+
62
+ }
63
 
64
  add_meta_box('accordions_product_metabox',__( 'Product FAQ Tab', 'accordions' ),'meta_boxes_accordions_product_input', 'product', 'side', 'high');
65
 
560
 
561
 
562
 
563
+
564
+ function meta_boxes_accordions_side( $post ) {
565
+ $class_accordions_support = new class_accordions_support();
566
+ ?>
567
+ <div class="post-grid-meta-box">
568
+
569
+ <ul>
570
+ <li>Version: <?php echo accordions_version; ?></li>
571
+ <li>Tested WP: 5.1</li>
572
+ </ul>
573
+
574
+ <h3>Try Premium</h3>
575
+ <a class="button" href="https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard" target="_blank">Buy Premium</a>
576
+ <p>We added some exclusive feature in premium version, you may try our pro version if you need.</p>
577
+
578
+ <h3>Documentation</h3>
579
+ <a class="button" href="http://pickplugins.com/docs/documentation/accordions/?ref=dashboard" target="_blank">Documentation</a><p class="description">Before asking, submitting reviews please take a look on our documentation, may help your issue fast.</p>
580
+
581
+ <h3>Looking for support?</h3>
582
+ <a class="button" href="https://www.pickplugins.com/questions/?ref=dashboard" target="_blank">Ask Question</a><p class="description">Its free and you can ask any question about our plugins and get support fast.</p>
583
+
584
+
585
+
586
+ <h3>Provide your feedback</h3>
587
+
588
+ <a class="button" href="https://wordpress.org/support/plugin/accordions/reviews/?filter=5" target="_blank">Submit Reviews</a> <a class="button" href="https://wordpress.org/support/plugin/accordions/#new-topic-0" target="_blank">Ask wordpress.org</a><p>We spent thousand+ hours to development on this plugin, please submit your reviews wisely.</p><p>If you have any issue with this plugin please submit our forums or contact our support first.</p><p class="description">Your feedback and reviews are most important things to keep our development on track. If you have time please submit us five star <a href="https://wordpress.org/support/plugin/accordions/reviews/?filter=5"><span style="color: orange"><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i></span></a> reviews.</p>
589
+
590
+
591
+
592
+ <?php
593
+ $video_tutorials = $class_accordions_support->faq();
594
+ if(!empty($video_tutorials)):
595
+ ?>
596
+ <div class="faq">
597
+ <h3>FAQ</h3>
598
+ <p class="description">Some feature may avilable in premium version, you will need to buy pro version and install first.</p>
599
+ <ul>
600
+ <?php
601
+ foreach($video_tutorials as $item){
602
+ ?>
603
+ <li class="item">
604
+ <a target="_blank" href="<?php echo $item['url']; ?>"><i class="far fa-dot-circle"></i> <?php echo $item['title']; ?></a>
605
+
606
+ </li>
607
+ <?php
608
+ }
609
+
610
+ ?>
611
+ </ul>
612
+ </div>
613
+ <?php
614
+
615
+ endif;
616
+ ?>
617
+
618
+
619
+
620
+ <?php
621
+ $video_tutorials = $class_accordions_support->video_tutorials();
622
+ if(!empty($video_tutorials)):
623
+ ?>
624
+ <div class="video-tutorials">
625
+ <h3>Video Tutorials</h3>
626
+ <p class="description">Some feature may avilable in premium version, you will need to buy pro version and install first. we used premium version to create video tutorials.</p>
627
+
628
+ <ul>
629
+ <?php
630
+ foreach($video_tutorials as $item){
631
+ ?>
632
+ <li class="item">
633
+ <a target="_blank" href="<?php echo $item['video_url']; ?>"><i class="far fa-dot-circle"></i> <?php echo $item['title']; ?></a>
634
+
635
+ </li>
636
+ <?php
637
+ }
638
+
639
+ ?>
640
+ </ul>
641
+ </div>
642
+ <?php
643
+
644
+ endif;
645
+ ?>
646
+
647
+
648
+ </div>
649
+ <?php
650
+
651
+ }
readme.txt CHANGED
@@ -3,8 +3,8 @@
3
  Donate link: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
4
  Tags: accordion, accordions, Responsive accordions, FAQ, WooCommerce FAQ, WooCommerce FAQ Tab, accordions plugin, jQuery accordions, accordions short-code, accordions Widget, accordions plugin wordpress, accordions plugin jquery, tabs, jquery tabs, tab, responsive tabs
5
  Requires at least: 3.8
6
- Tested up to: 5.1
7
- Stable tag: 2.1.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -92,6 +92,11 @@ then paste this shortcode anywhere in your page to display accordions<br />
92
 
93
  == Changelog ==
94
 
 
 
 
 
 
95
  = 2.1.10 =
96
  * 05/02/2019 - fix - js issue fixed.
97
 
3
  Donate link: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
4
  Tags: accordion, accordions, Responsive accordions, FAQ, WooCommerce FAQ, WooCommerce FAQ Tab, accordions plugin, jQuery accordions, accordions short-code, accordions Widget, accordions plugin wordpress, accordions plugin jquery, tabs, jquery tabs, tab, responsive tabs
5
  Requires at least: 3.8
6
+ Tested up to: 5.2
7
+ Stable tag: 2.1.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
92
 
93
  == Changelog ==
94
 
95
+ = 2.1.10 =
96
+ * 21/03/2019 - add - video tutorials added.
97
+ * 21/03/2019 - update - update accordion content editor.
98
+ * 21/03/2019 - remove - remove help & support menu.
99
+
100
  = 2.1.10 =
101
  * 05/02/2019 - fix - js issue fixed.
102