Ultimate FAQ - Version 2.1.0

Version Description

(2021-12-21) = - Changed how premium settings areas are previewed. - CSS styling update for the FAQ Details area on the FAQ edit screen.

Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Ultimate FAQ
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.26 to 2.1.0

Files changed (50) hide show
  1. assets/css/ewd-ufaq-admin.css +53 -2
  2. assets/css/ewd-ufaq-helper-install-notice.css +6 -1
  3. assets/img/premium-screenshots/fields.png +0 -0
  4. assets/img/premium-screenshots/labelling1.png +0 -0
  5. assets/img/premium-screenshots/labelling2.png +0 -0
  6. assets/img/premium-screenshots/premium1.png +0 -0
  7. assets/img/premium-screenshots/premium2.png +0 -0
  8. assets/img/premium-screenshots/styling1.png +0 -0
  9. assets/img/premium-screenshots/styling2.png +0 -0
  10. assets/js/ewd-ufaq-admin.js +10 -1
  11. assets/js/ewd-ufaq-helper-install-notice.js +6 -2
  12. includes/Dashboard.class.php +0 -21
  13. includes/Export.class.php +0 -252
  14. includes/Import.class.php +0 -315
  15. includes/Settings.class.php +233 -1549
  16. lib/simple-admin-pages/classes/AdminPage.Menu.class.php +1 -1
  17. lib/simple-admin-pages/classes/AdminPage.Submenu.class.php +1 -1
  18. lib/simple-admin-pages/classes/AdminPage.Themes.class.php +1 -1
  19. lib/simple-admin-pages/classes/AdminPage.class.php +5 -1
  20. lib/simple-admin-pages/classes/AdminPageSection.class.php +8 -2
  21. lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php +1 -1
  22. lib/simple-admin-pages/classes/AdminPageSetting.Checkbox.class.php +1 -1
  23. lib/simple-admin-pages/classes/AdminPageSetting.ColorPicker.class.php +1 -1
  24. lib/simple-admin-pages/classes/AdminPageSetting.Count.class.php +1 -1
  25. lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php +1 -1
  26. lib/simple-admin-pages/classes/AdminPageSetting.FileUpload.class.php +1 -1
  27. lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php +1 -1
  28. lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php +1 -1
  29. lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php +1 -1
  30. lib/simple-admin-pages/classes/AdminPageSetting.McApiKey.class.php +1 -1
  31. lib/simple-admin-pages/classes/AdminPageSetting.McListMerge.class.php +1 -1
  32. lib/simple-admin-pages/classes/AdminPageSetting.Number.class.php +1 -1
  33. lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php +1 -1
  34. lib/simple-admin-pages/classes/AdminPageSetting.Ordering.class.php +1 -1
  35. lib/simple-admin-pages/classes/AdminPageSetting.Radio.class.php +1 -1
  36. lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php +1 -1
  37. lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php +1 -1
  38. lib/simple-admin-pages/classes/AdminPageSetting.SelectMenu.class.php +1 -1
  39. lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php +1 -1
  40. lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php +1 -1
  41. lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php +1 -1
  42. lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php +1 -1
  43. lib/simple-admin-pages/classes/AdminPageSetting.Time.class.php +1 -1
  44. lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php +1 -1
  45. lib/simple-admin-pages/classes/AdminPageSetting.WarningTip.class.php +1 -1
  46. lib/simple-admin-pages/classes/AdminPageSetting.class.php +1 -1
  47. lib/simple-admin-pages/classes/Library.class.php +4 -4
  48. lib/simple-admin-pages/js/admin-settings.js +3 -2
  49. readme.txt +4 -0
  50. ultimate-faqs.php +149 -43
assets/css/ewd-ufaq-admin.css CHANGED
@@ -1117,7 +1117,58 @@ input[name="ewd_ufaq_export_pdf"] {
1117
  margin-top: 8px !important;
1118
  }
1119
 
1120
- .ewd-ufaq-helper-install-notice {
1121
  display: inline-block;
1122
- clear: both;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1123
  }
1117
  margin-top: 8px !important;
1118
  }
1119
 
1120
+ .ewd-ufaq-meta-field label {
1121
  display: inline-block;
1122
+ width: 150px;
1123
+ margin: 12px 0;
1124
+ }
1125
+
1126
+ /*************************
1127
+ SETTINGS PREVIEW SCREENS
1128
+ *************************/
1129
+ .ewd-ufaq-settings-preview h2 {
1130
+ font-size: 24px !important;
1131
+ }
1132
+ .ewd-ufaq-settings-preview h2 span {
1133
+ position: absolute;
1134
+ margin-left: 16px;
1135
+ font-size: .45em;
1136
+ color: #fff;
1137
+ background: #aaa;
1138
+ border-radius: 50px;
1139
+ padding: 2px 8px;
1140
+ text-transform: uppercase;
1141
+ }
1142
+
1143
+ .ewd-ufaq-settings-preview-images {
1144
+ position: relative;
1145
+ float: left;
1146
+ width: 100%;
1147
+ margin: 36px 0 48px;
1148
+ }
1149
+ .ewd-ufaq-settings-preview img {
1150
+ position: relative;
1151
+ float: left;
1152
+ box-sizing: border-box;
1153
+ width: 35%;
1154
+ height: auto;
1155
+ border: 8px solid #ddd;
1156
+ margin-right: 40px;
1157
+ }
1158
+
1159
+ .ewd-ufaq-settings-preview .ewd-ufaq-dashboard-new-footer-one-benefits {
1160
+ margin-top: 24px;
1161
+ }
1162
+
1163
+ .ewd-ufaq-settings-preview .ewd-ufaq-dashboard-new-footer-one-buttons {
1164
+ float: left;
1165
+ margin-top: 32px;
1166
+ }
1167
+
1168
+ @media screen and (max-width: 568px) {
1169
+ .ewd-ufaq-settings-preview img {
1170
+ width: 100%;
1171
+ margin-right: 0;
1172
+ margin-top: 12px;
1173
+ }
1174
  }
assets/css/ewd-ufaq-helper-install-notice.css CHANGED
@@ -2,6 +2,11 @@
2
  clear: both;
3
  }
4
 
 
 
 
 
 
5
  .ewd-ufaq-helper-install-notice-img,
6
  .ewd-ufaq-helper-install-notice-txt
7
  {
@@ -11,4 +16,4 @@
11
 
12
  .ewd-ufaq-helper-install-notice div img {
13
  max-height: 36px;
14
- }
2
  clear: both;
3
  }
4
 
5
+ .ewd-ufaq-helper-install-notice {
6
+ display: inline-block;
7
+ clear: both;
8
+ }
9
+
10
  .ewd-ufaq-helper-install-notice-img,
11
  .ewd-ufaq-helper-install-notice-txt
12
  {
16
 
17
  .ewd-ufaq-helper-install-notice div img {
18
  max-height: 36px;
19
+ }
assets/img/premium-screenshots/fields.png ADDED
Binary file
assets/img/premium-screenshots/labelling1.png ADDED
Binary file
assets/img/premium-screenshots/labelling2.png ADDED
Binary file
assets/img/premium-screenshots/premium1.png ADDED
Binary file
assets/img/premium-screenshots/premium2.png ADDED
Binary file
assets/img/premium-screenshots/styling1.png ADDED
Binary file
assets/img/premium-screenshots/styling2.png ADDED
Binary file
assets/js/ewd-ufaq-admin.js CHANGED
@@ -68,4 +68,13 @@ function ewd_ufaq_field_added_handler() {
68
 
69
  jQuery( '.sap-infinite-table tbody tr:last-of-type span.sap-infinite-table-hidden-value' ).html( highest + 1 );
70
  jQuery( '.sap-infinite-table tbody tr:last-of-type input[data-name="id"]' ).val( highest + 1 );
71
- }
 
 
 
 
 
 
 
 
 
68
 
69
  jQuery( '.sap-infinite-table tbody tr:last-of-type span.sap-infinite-table-hidden-value' ).html( highest + 1 );
70
  jQuery( '.sap-infinite-table tbody tr:last-of-type input[data-name="id"]' ).val( highest + 1 );
71
+ }
72
+
73
+
74
+ //SETTINGS PREVIEW SCREENS
75
+
76
+ jQuery( document ).ready( function() {
77
+
78
+ jQuery( '.ewd-ufaq-settings-preview' ).prev( 'h2' ).hide();
79
+ });
80
+
assets/js/ewd-ufaq-helper-install-notice.js CHANGED
@@ -1,7 +1,11 @@
1
  jQuery( document ).ready( function( $ ) {
2
-
3
  jQuery(document).on( 'click', '.ewd-ufaq-helper-install-notice .notice-dismiss', function( event ) {
4
- var data = 'action=ewd_ufaq_hide_helper_notice';
 
 
 
 
5
  jQuery.post( ajaxurl, data, function() {} );
6
  });
7
  });
1
  jQuery( document ).ready( function( $ ) {
2
+
3
  jQuery(document).on( 'click', '.ewd-ufaq-helper-install-notice .notice-dismiss', function( event ) {
4
+ var data = jQuery.param({
5
+ action: 'ewd_ufaq_hide_helper_notice',
6
+ nonce: ewd_ufaq_helper_notice.nonce
7
+ });
8
+
9
  jQuery.post( ajaxurl, data, function() {} );
10
  });
11
  });
includes/Dashboard.class.php CHANGED
@@ -15,8 +15,6 @@ class ewdufaqDashboard {
15
  public function __construct() {
16
  add_action( 'admin_menu', array( $this, 'add_dashboard_to_menu' ), 99 );
17
 
18
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
19
-
20
  add_action( 'wp_ajax_ewd_ufaq_hide_upgrade_box', array($this, 'hide_upgrade_box') );
21
  add_action( 'wp_ajax_ewd_ufaq_display_upgrade_box', array($this, 'display_upgrade_box') );
22
  }
@@ -56,25 +54,6 @@ class ewdufaqDashboard {
56
  $submenu['edit.php?post_type=ufaq'] = $new_submenu;
57
  }
58
 
59
- // Enqueues the admin script so that our hacky sub-menu opening function can run
60
- public function enqueue_scripts() {
61
- global $admin_page_hooks;
62
-
63
- $currentScreen = get_current_screen();
64
- if ( $currentScreen->id == $admin_page_hooks['edit.php?post_type=ufaq'] . '_page_ewd-ufaq-dashboard' ) {
65
-
66
- wp_enqueue_style( 'ewd-ufaq-admin-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-admin.css', array(), EWD_UFAQ_VERSION );
67
-
68
- wp_register_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery', 'jquery-ui-sortable' ), EWD_UFAQ_VERSION, true );
69
-
70
- $args = array();
71
-
72
- wp_localize_script( 'ewd-ufaq-admin-js', 'ewd_ufaq_php_data', $args );
73
-
74
- wp_enqueue_script( 'ewd-ufaq-admin-js' );
75
- }
76
- }
77
-
78
  public function display_dashboard_screen() {
79
  global $ewd_ufaq_controller;
80
 
15
  public function __construct() {
16
  add_action( 'admin_menu', array( $this, 'add_dashboard_to_menu' ), 99 );
17
 
 
 
18
  add_action( 'wp_ajax_ewd_ufaq_hide_upgrade_box', array($this, 'hide_upgrade_box') );
19
  add_action( 'wp_ajax_ewd_ufaq_display_upgrade_box', array($this, 'display_upgrade_box') );
20
  }
54
  $submenu['edit.php?post_type=ufaq'] = $new_submenu;
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  public function display_dashboard_screen() {
58
  global $ewd_ufaq_controller;
59
 
includes/Export.class.php DELETED
@@ -1,252 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class to export reviews created by the plugin
5
- */
6
-
7
- if ( !defined( 'ABSPATH' ) )
8
- exit;
9
-
10
- if (!class_exists('ComposerAutoloaderInit4618f5c41cf5e27cc7908556f031e4d4')) { require_once EWD_UFAQ_PLUGIN_DIR . '/lib/PHPSpreadsheet/vendor/autoload.php'; }
11
- use PhpOffice\PhpSpreadsheet\Spreadsheet;
12
- use PhpOffice\PhpSpreadsheet\Writer\Xls;
13
- use PhpOffice\PhpSpreadsheet\Writer\Csv;
14
- class ewdufaqExport {
15
-
16
- public function __construct() {
17
- add_action( 'admin_menu', array($this, 'register_install_screen' ));
18
-
19
- if ( isset( $_POST['ewd_ufaq_export'] ) ) { add_action( 'admin_menu', array($this, 'export_faqs' )); }
20
- if ( isset( $_POST['ewd_ufaq_export_pdf'] ) ) { add_action( 'admin_menu', array($this, 'export_faqs_pdf' )); }
21
-
22
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_export_scripts' ) );
23
- }
24
-
25
- public function register_install_screen() {
26
- global $ewd_ufaq_controller;
27
-
28
- add_submenu_page(
29
- 'edit.php?post_type=ufaq',
30
- 'Export Menu',
31
- 'Export',
32
- $ewd_ufaq_controller->settings->get_setting( 'access-role' ),
33
- 'ewd-ufaq-export',
34
- array($this, 'display_export_screen')
35
- );
36
- }
37
-
38
- public function display_export_screen() {
39
- global $ewd_ufaq_controller;
40
-
41
- $export_permission = $ewd_ufaq_controller->permissions->check_permission( 'export' );
42
-
43
- ?>
44
- <div class='wrap'>
45
- <h2>Export</h2>
46
- <?php if ( $export_permission ) { ?>
47
- <form method='post'>
48
- <?php wp_nonce_field( 'EWD_UFAQ_Export_PDF', 'EWD_UFAQ_Export_PDF_Nonce' ); ?>
49
- <input type='submit' name='ewd_ufaq_export' value='Export to Spreadsheet' class='button button-primary' />
50
- </form>
51
- <form method='post'>
52
- <?php wp_nonce_field( 'EWD_UFAQ_Export_PDF', 'EWD_UFAQ_Export_PDF_Nonce' ); ?>
53
- <input type='submit' name='ewd_ufaq_export_pdf' value='Export to PDF' class='button button-primary' />
54
- </form>
55
- <?php } else { ?>
56
- <div class='ewd-ufaq-premium-locked'>
57
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">Upgrade</a> to the premium version to use this feature
58
- </div>
59
- <?php } ?>
60
- </div>
61
- <?php }
62
-
63
- public function export_faqs() {
64
- global $ewd_ufaq_controller;
65
-
66
- if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; }
67
-
68
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; }
69
-
70
- $faq_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
71
-
72
- // Instantiate a new PHPExcel object
73
- $spreadsheet = new Spreadsheet();
74
- // Set the active Excel worksheet to sheet 0
75
- $spreadsheet->setActiveSheetIndex(0);
76
-
77
- // Print out the regular review field labels
78
- $spreadsheet->getActiveSheet()->setCellValue( 'A1', 'ID' );
79
- $spreadsheet->getActiveSheet()->setCellValue( 'B1', 'Question' );
80
- $spreadsheet->getActiveSheet()->setCellValue( 'C1', 'Answer' );
81
- $spreadsheet->getActiveSheet()->setCellValue( 'D1', 'Categories' );
82
- $spreadsheet->getActiveSheet()->setCellValue( 'E1', 'Tags' );
83
- $spreadsheet->getActiveSheet()->setCellValue( 'F1', 'Post Date' );
84
-
85
- $column = 'G';
86
- foreach ( $faq_fields as $faq_field ) {
87
-
88
- $spreadsheet->getActiveSheet()->setCellValue( $column . '1', $faq_field->name );
89
- $column++;
90
- }
91
-
92
- //start while loop to get data
93
- $row_count = 2;
94
-
95
- $params = array(
96
- 'posts_per_page' => -1,
97
- 'post_type' => EWD_UFAQ_FAQ_POST_TYPE
98
- );
99
-
100
- $faqs = get_posts( $params );
101
-
102
- foreach ( $faqs as $faq ) {
103
-
104
- $categories = strip_tags( get_the_term_list( $faq->ID, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, '', ',' ) );
105
- $tags = strip_tags( get_the_term_list( $faq->ID, EWD_UFAQ_FAQ_TAG_TAXONOMY, '', ',' ) );
106
-
107
- $spreadsheet->getActiveSheet()->setCellValue( 'A' . $row_count, $faq->ID );
108
- $spreadsheet->getActiveSheet()->setCellValue( 'B' . $row_count, $faq->post_title );
109
- $spreadsheet->getActiveSheet()->setCellValue( 'C' . $row_count, $faq->post_content );
110
- $spreadsheet->getActiveSheet()->setCellValue( 'D' . $row_count, $categories );
111
- $spreadsheet->getActiveSheet()->setCellValue( 'E' . $row_count, $tags );
112
- $spreadsheet->getActiveSheet()->setCellValue( 'F' . $row_count, $faq->post_date );
113
-
114
- $column = 'G';
115
- foreach ( $faq_fields as $faq_field ) {
116
-
117
- $field_value = get_post_meta( $faq->ID, "Custom_Field_" . $faq_field->id, true );
118
- $field_value = is_array( $field_value ) ? implode( ',', $field_value ) : $field_value;
119
-
120
- $spreadsheet->getActiveSheet()->setCellValue( $column . $row_count, $field_value );
121
- $column++;
122
- }
123
-
124
- $row_count++;
125
- }
126
-
127
- // Redirect output to a client’s web browser (Excel5)
128
- if (!isset($format_type) == "csv") {
129
-
130
- header('Content-Type: application/vnd.ms-excel');
131
- header('Content-Disposition: attachment;filename="faqs_export.csv"');
132
- header('Cache-Control: max-age=0');
133
- $objWriter = new Csv($spreadsheet);
134
- $objWriter->save('php://output');
135
- die();
136
- }
137
- else {
138
-
139
- header('Content-Type: application/vnd.ms-excel');
140
- header('Content-Disposition: attachment;filename="faqs_export.xls"');
141
- header('Cache-Control: max-age=0');
142
- $objWriter = new Xls($spreadsheet);
143
- $objWriter->save('php://output');
144
- die();
145
- }
146
- }
147
-
148
- public function export_faqs_pdf() {
149
- global $ewd_ufaq_controller;
150
-
151
- if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; }
152
-
153
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; }
154
-
155
- $faq_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
156
-
157
- require_once EWD_UFAQ_PLUGIN_DIR . '/lib/FPDF/fpdf.php' ;
158
-
159
- $params = array(
160
- 'posts_per_page' => -1,
161
- 'post_type' => EWD_UFAQ_FAQ_POST_TYPE
162
- );
163
-
164
- $faqs = get_posts( $params );
165
-
166
- $pdf_passes = array(
167
- 'first_page_run',
168
- 'second_page_run',
169
- 'final'
170
- );
171
-
172
- $table_of_contents = array();
173
-
174
- foreach ( $pdf_passes as $pdf_pass ) {
175
-
176
- $pdf = new FPDF();
177
- $pdf->AddPage();
178
-
179
- if ( $pdf_pass == 'second_page_run' or $pdf_pass == 'final' ) {
180
-
181
- $pdf->SetFont( 'Arial', 'B', 14 );
182
- $pdf->Cell( 20, 10, 'Page #' );
183
- $pdf->Cell( 20, 10, 'Article Title' );
184
- $pdf->Ln();
185
- $pdf->SetFont( 'Arial', '', 12 );
186
-
187
- foreach ( $table_of_contents as $entry ) {
188
- $pdf->Cell(20, 5, " " . $entry['page']);
189
- $pdf->MultiCell(0, 5, $entry['title']);
190
- $pdf->Ln();
191
- }
192
-
193
- unset( $table_of_contents );
194
- }
195
-
196
- foreach ($faqs as $faq) {
197
-
198
- $question = utf8_decode( strip_tags( html_entity_decode( $faq->post_title ) ) );
199
-
200
- $answer = utf8_decode( strip_tags( html_entity_decode( $faq->post_content ) ) );
201
- $answer = str_replace( '&#91;', '[', $answer );
202
- $answer = str_replace( '&#93;', ']', $answer );
203
-
204
- $pdf->AddPage();
205
-
206
- $entry = array(
207
- 'page' => $pdf->GetPage(),
208
- 'title' => $question
209
- );
210
-
211
- $pdf->SetFont( 'Arial', 'B', 15 );
212
- $pdf->MultiCell( 0, 10, $question );
213
- $pdf->Ln();
214
- $pdf->SetFont( 'Arial', '', 12 );
215
- $pdf->MultiCell( 0, 10, $answer );
216
-
217
- $table_of_contents[] = $entry;
218
- }
219
-
220
- if ( $pdf_pass == 'first_page_run' or $pdf_pass == 'second_page_run' ) {
221
-
222
- $pdf->Close();
223
- }
224
-
225
- if ( $pdf_pass == 'final' ) {
226
-
227
- $pdf->Output( 'Ultimate-FAQ-Manual.pdf', 'D' );
228
- }
229
- }
230
- }
231
-
232
- public function enqueue_export_scripts() {
233
-
234
- $screen = get_current_screen();
235
-
236
- if ( $screen->id == 'ufaq_page_ewd-ufaq-export' ) {
237
-
238
- wp_enqueue_style( 'ewd-ufaq-admin-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-admin.css', array(), EWD_UFAQ_VERSION );
239
-
240
- wp_register_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery', 'jquery-ui-sortable' ), EWD_UFAQ_VERSION, true );
241
-
242
- $args = array();
243
-
244
- wp_localize_script( 'ewd-ufaq-admin-js', 'ewd_ufaq_php_data', $args );
245
-
246
- wp_enqueue_script( 'ewd-ufaq-admin-js' );
247
- }
248
- }
249
-
250
- }
251
-
252
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/Import.class.php DELETED
@@ -1,315 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class to handle importing FAQs into the plugin
5
- */
6
-
7
- if ( !defined( 'ABSPATH' ) )
8
- exit;
9
-
10
- if (!class_exists('ComposerAutoloaderInit4618f5c41cf5e27cc7908556f031e4d4')) {require_once EWD_UFAQ_PLUGIN_DIR . '/lib/PHPSpreadsheet/vendor/autoload.php';}
11
- use PhpOffice\PhpSpreadsheet\Spreadsheet;
12
- class ewdufaqImport {
13
-
14
- public $status;
15
- public $message;
16
-
17
- public function __construct() {
18
- add_action( 'admin_menu', array($this, 'register_install_screen' ));
19
-
20
- if ( isset( $_POST['ewdufaqImport'] ) ) { add_action( 'admin_init', array($this, 'import_faqs' )); }
21
-
22
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_import_scripts' ) );
23
- }
24
-
25
- public function register_install_screen() {
26
- global $ewd_ufaq_controller;
27
-
28
- add_submenu_page(
29
- 'edit.php?post_type=ufaq',
30
- 'Import Menu',
31
- 'Import',
32
- $ewd_ufaq_controller->settings->get_setting( 'access-role' ),
33
- 'ewd-ufaq-import',
34
- array($this, 'display_import_screen')
35
- );
36
- }
37
-
38
- public function display_import_screen() {
39
- global $ewd_ufaq_controller;
40
-
41
- $import_permission = $ewd_ufaq_controller->permissions->check_permission( 'import' );
42
- ?>
43
- <div class='wrap'>
44
- <h2>Import</h2>
45
- <?php if ( $import_permission ) { ?>
46
- <form method='post' enctype="multipart/form-data">
47
-
48
- <?php wp_nonce_field( 'EWD_UFAQ_Import', 'EWD_UFAQ_Import_Nonce' ); ?>
49
-
50
- <p>
51
- <label for="ewd_ufaq_faqs_spreadsheet"><?php _e( 'Spreadsheet Containing FAQs', 'ultimate-faqs' ) ?></label><br />
52
- <input name="ewd_ufaq_faqs_spreadsheet" type="file" value=""/>
53
- </p>
54
- <input type='submit' name='ewdufaqImport' value='Import FAQs' class='button button-primary' />
55
- </form>
56
- <?php } else { ?>
57
- <div class='ewd-ufaq-premium-locked'>
58
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">Upgrade</a> to the premium version to use this feature
59
- </div>
60
- <?php } ?>
61
- </div>
62
- <?php }
63
-
64
- public function import_faqs() {
65
- global $ewd_ufaq_controller;
66
-
67
- if ( ! current_user_can( 'edit_posts' ) ) { return; }
68
-
69
- if ( ! isset( $_POST['EWD_UFAQ_Import_Nonce'] ) ) { return; }
70
-
71
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Import_Nonce'], 'EWD_UFAQ_Import' ) ) { return; }
72
-
73
- $update = $this->handle_spreadsheet_upload();
74
-
75
- $fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
76
-
77
- if ( $update['message_type'] != 'Success' ) :
78
- $this->status = false;
79
- $this->message = $update['message'];
80
-
81
- add_action( 'admin_notices', array( $this, 'display_notice' ) );
82
-
83
- return;
84
- endif;
85
-
86
- $excel_url = EWD_UFAQ_PLUGIN_DIR . '/faq-sheets/' . $update['filename'];
87
-
88
- // Build the workbook object out of the uploaded spreadsheet
89
- $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load( $excel_url );
90
-
91
- // Create a worksheet object out of the product sheet in the workbook
92
- $sheet = $spreadsheet->getActiveSheet();
93
-
94
- $allowable_custom_fields = array();
95
- foreach ( $fields as $field ) { $allowable_custom_fields[] = $field->name; }
96
- //List of fields that can be accepted via upload
97
- $allowed_fields = array( 'ID', 'Question', 'Answer', 'Categories', 'Tags', 'Post Date' );
98
-
99
- // Get column names
100
- $highest_column = $sheet->getHighestColumn();
101
- $highest_column_index = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString( $highest_column );
102
- for ( $column = 1; $column <= $highest_column_index; $column++ ) {
103
-
104
- if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'ID' ) { $ID_column = $column; }
105
- if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Question' ) { $question_column = $column; }
106
- if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Answer' ) { $answer_column = $column; }
107
- if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Categories' ) { $categories_column = $column; }
108
- if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Tags' ) { $tags_column = $column; }
109
- if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Post Date' ) { $date_column = $column; }
110
-
111
- foreach ( $fields as $field ) {
112
-
113
- if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == $field->name ) { $field->column = $column; }
114
- }
115
- }
116
-
117
- $ID_column = ! empty( $ID_column ) ? $ID_column : -1;
118
- $question_column = ! empty( $question_column ) ? $question_column : -1;
119
- $answer_column = ! empty( $answer_column ) ? $answer_column : -1;
120
- $categories_column = ! empty( $categories_column ) ? $categories_column : -1;
121
- $tags_column = ! empty( $tags_column ) ? $tags_column : -1;
122
- $date_column = ! empty( $date_column ) ? $date_column : -1;
123
-
124
- // Put the spreadsheet data into a multi-dimensional array to facilitate processing
125
- $highest_row = $sheet->getHighestRow();
126
- for ( $row = 2; $row <= $highest_row; $row++ ) {
127
- for ( $column = 1; $column <= $highest_column_index; $column++ ) {
128
- $data[$row][$column] = $sheet->getCellByColumnAndRow( $column, $row )->getValue();
129
- }
130
- }
131
-
132
- // Create the query to insert the products one at a time into the database and then run it
133
- foreach ( $data as $faq ) {
134
-
135
- // Create an array of the values that are being inserted for each FAQ
136
- $post = array();
137
- $field_values = array();
138
- foreach ( $faq as $col_index => $value ) {
139
-
140
- if ( $col_index == $ID_column ) { $post['ID'] = esc_sql( $value ); }
141
- elseif ( $col_index == $question_column ) { $post['post_title'] = esc_sql( $value ); }
142
- elseif ( $col_index == $answer_column ) { $post['post_content'] = esc_sql( $value ); }
143
- elseif ( $col_index == $date_column ) { $post['post_date'] = esc_sql( $value ); }
144
- elseif ( $col_index == $categories_column ) { $post_categories = explode( ',', esc_sql( $value ) ); }
145
- elseif ( $col_index == $tags_column ) { $post_tags = explode( ',', esc_sql( $value ) ); }
146
- else {
147
-
148
- foreach ( $fields as $field ) {
149
-
150
- if ( $col_index == $field->column ) { $field_values[ $field->name ] = esc_sql( $value ); }
151
- }
152
- }
153
- }
154
-
155
- if ( ! empty( $post['ID'] ) and get_post_type( $post['ID'] ) != 'ufaq' ) { continue; }
156
-
157
- $post['post_status'] = 'publish';
158
- $post['post_type'] = EWD_UFAQ_FAQ_POST_TYPE;
159
-
160
-
161
-
162
- $post_id = wp_insert_post( $post );
163
-
164
- // Required post_meta
165
- update_post_meta( $post_id, 'ufaq_order', 9999 );
166
-
167
- if ( $post_id != 0 ) {
168
-
169
- if ( ! empty( $post_categories ) ) {
170
-
171
- $category_ids = array();
172
- foreach ( $post_categories as $category ) {
173
-
174
- $term = term_exists( $category, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
175
- if ( ! empty( $term ) ) { $category_ids[] = (int) $term['term_id']; }
176
- }
177
- }
178
- if ( isset( $category_ids ) and is_array( $category_ids ) ) { wp_set_object_terms( $post_id, $category_ids, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY ); }
179
-
180
- if ( ! empty( $post_tags ) ) {
181
-
182
- $tag_ids = array();
183
- foreach ( $post_tags as $tag ) {
184
-
185
- $term = term_exists( $tag, EWD_UFAQ_FAQ_TAG_TAXONOMY );
186
- if ( ! empty( $term ) ) { $tag_ids[] = (int) $term['term_id']; }
187
- }
188
- }
189
- if ( isset( $tag_ids ) and is_array( $tag_ids ) ) { wp_set_object_terms( $post_id, $tag_ids, EWD_UFAQ_FAQ_TAG_TAXONOMY ); }
190
-
191
- foreach ( $fields as $field ) {
192
-
193
- if ( empty( $field->column ) ) { continue; }
194
-
195
- if ( $field->type == 'checkbox' ) { update_post_meta( $post_id, "Custom_Field_" . $field->id, explode( ',', $field_values[ $field->name ] ) ); }
196
- else { update_post_meta( $post_id, "Custom_Field_" . $field->id, $field_values[ $field->name ]); }
197
- }
198
- }
199
-
200
- unset( $post_categories );
201
- unset( $category_ids );
202
- unset( $post_tags );
203
- unset( $tag_ids );
204
- }
205
-
206
- $this->status = true;
207
- $this->message = __( 'FAQs added successfully.', 'ultimate-faqs' );
208
-
209
- add_action( 'admin_notices', array( $this, 'display_notice' ) );
210
- }
211
-
212
- function handle_spreadsheet_upload() {
213
- /* Test if there is an error with the uploaded spreadsheet and return that error if there is */
214
- if ( ! empty( $_FILES['ewd_ufaq_faqs_spreadsheet']['error'] ) ) {
215
-
216
- switch( $_FILES['ewd_ufaq_faqs_spreadsheet']['error'] ) {
217
-
218
- case '1':
219
- $error = __( 'The uploaded file exceeds the upload_max_filesize directive in php.ini', 'ultimate-faqs' );
220
- break;
221
- case '2':
222
- $error = __( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', 'ultimate-faqs' );
223
- break;
224
- case '3':
225
- $error = __( 'The uploaded file was only partially uploaded', 'ultimate-faqs' );
226
- break;
227
- case '4':
228
- $error = __( 'No file was uploaded.', 'ultimate-faqs' );
229
- break;
230
-
231
- case '6':
232
- $error = __( 'Missing a temporary folder', 'ultimate-faqs' );
233
- break;
234
- case '7':
235
- $error = __( 'Failed to write file to disk', 'ultimate-faqs' );
236
- break;
237
- case '8':
238
- $error = __( 'File upload stopped by extension', 'ultimate-faqs' );
239
- break;
240
- case '999':
241
- default:
242
- $error = __( 'No error code avaiable', 'ultimate-faqs' );
243
- }
244
- }
245
- /* Make sure that the file exists */
246
- elseif ( empty($_FILES['ewd_ufaq_faqs_spreadsheet']['tmp_name']) || $_FILES['ewd_ufaq_faqs_spreadsheet']['tmp_name'] == 'none' ) {
247
- $error = __( 'No file was uploaded here..', 'ultimate-faqs' );
248
- }
249
- /* Move the file and store the URL to pass it onwards*/
250
- /* Check that it is a .xls or .xlsx file */
251
- if ( ! isset($_FILES['ewd_ufaq_faqs_spreadsheet']['name'] ) or ( ! preg_match("/\.(xls.?)$/", $_FILES['ewd_ufaq_faqs_spreadsheet']['name'] ) and ! preg_match( "/\.(csv.?)$/", $_FILES['ewd_ufaq_faqs_spreadsheet']['name'] ) ) ) {
252
- $error = __( 'File must be .csv, .xls or .xlsx', 'ultimate-faqs' );
253
- }
254
- else {
255
- $filename = basename( $_FILES['ewd_ufaq_faqs_spreadsheet']['name'] );
256
- $filename = mb_ereg_replace( "([^\w\s\d\-_~,;\[\]\(\).])", '', $filename );
257
- $filename = mb_ereg_replace ("([\.]{2,})", '', $filename );
258
-
259
- //for security reason, we force to remove all uploaded file
260
- $target_path = EWD_UFAQ_PLUGIN_DIR . "/faq-sheets/";
261
-
262
- $target_path = $target_path . $filename;
263
-
264
- if ( ! move_uploaded_file($_FILES['ewd_ufaq_faqs_spreadsheet']['tmp_name'], $target_path ) ) {
265
- $error .= "There was an error uploading the file, please try again!";
266
- }
267
- else {
268
- $excel_file_name = $filename;
269
- }
270
- }
271
-
272
- /* Pass the data to the appropriate function in Update_Admin_Databases.php to create the products */
273
- if ( ! isset( $error ) ) {
274
- $update = array( "message_type" => "Success", "filename" => $excel_file_name );
275
- }
276
- else {
277
- $update = array( "message_type" => "Error", "message" => $error );
278
- }
279
-
280
- return $update;
281
- }
282
-
283
- public function enqueue_import_scripts() {
284
-
285
- $screen = get_current_screen();
286
-
287
- if ( $screen->id == 'ufaq_page_ewd-ufaq-import' ) {
288
-
289
- wp_enqueue_style( 'ewd-ufaq-admin-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-admin.css', array(), '2.0.0' );
290
-
291
- wp_register_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery', 'jquery-ui-sortable' ), EWD_UFAQ_VERSION, true );
292
-
293
- $args = array();
294
-
295
- wp_localize_script( 'ewd-ufaq-admin-js', 'ewd_ufaq_php_data', $args );
296
-
297
- wp_enqueue_script( 'ewd-ufaq-admin-js' );
298
- }
299
- }
300
-
301
- public function display_notice() {
302
-
303
- if ( $this->status ) {
304
-
305
- echo "<div class='updated'><p>" . $this->message . "</p></div>";
306
- }
307
- else {
308
-
309
- echo "<div class='error'><p>" . $this->message . "</p></div>";
310
- }
311
- }
312
-
313
- }
314
-
315
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/Settings.class.php CHANGED
@@ -35,49 +35,15 @@ class ewdufaqSettings {
35
 
36
  $this->defaults = array(
37
 
38
- 'include-permalink' => 'none',
39
- 'permalink-type' => 'same_page',
40
- 'access-role' => 'manage_options',
41
-
42
- 'display-style' => 'default',
43
- 'slug-base' => 'ufaqs',
44
- 'number-of-columns' => 'one',
45
- 'faqs-per-page' => 100000,
46
- 'page-type' => 'distinct',
47
- 'wpforms-faq-location' => 'above',
48
-
49
- 'category-order' => 'asc',
50
- 'faq-order-by' => 'title',
51
- 'faq-order' => 'asc',
52
-
53
- 'faq-fields' => array(),
54
-
55
- 'styling-toggle-symbol' => 'A',
56
- 'styling-category-heading-type' => 'h3',
57
- 'styling-faq-heading-type' => 'h4',
58
-
59
- 'faq-elements-order' => json_encode(
60
- array(
61
- 'categories' => 'Categories',
62
- 'body' => 'Body',
63
- 'author_date' => 'Author/Date',
64
- 'custom_fields' => 'Custom Fields',
65
- 'tags' => 'Tags',
66
- 'ratings' => 'Ratings',
67
- 'social_media' => 'Social Media',
68
- 'permalink' => 'Permalink',
69
- 'comments' => 'Comments',
70
- 'back_to_top' => 'Back to Top',
71
- )
72
- ),
73
-
74
- 'label-retrieving-results' => __( 'Retrieving Results', 'ultimate-faqs' ),
75
- 'label-no-results-found' => __( 'No result FAQ\'s contained the term \'%s\'', 'ultimate-faqs' ),
76
- 'label-woocommerce-tab' => __( 'FAQs', 'ultimate-faqs' ),
77
- 'label-thank-you-submit' => __( 'Thank you for submitting an FAQ.', 'ultimate-faqs' ),
78
  );
79
 
80
- $this->defaults = apply_filters( 'ewd_ufaq_defaults', $this->defaults );
81
  }
82
 
83
  /**
@@ -127,11 +93,11 @@ class ewdufaqSettings {
127
  public function load_settings_panel() {
128
 
129
  global $ewd_ufaq_controller;
130
-
131
  require_once( EWD_UFAQ_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php' );
132
  $sap = sap_initialize_library(
133
  $args = array(
134
- 'version' => '2.6.1',
135
  'lib_url' => EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/',
136
  'theme' => 'purple',
137
  )
@@ -419,1585 +385,303 @@ class ewdufaqSettings {
419
  )
420
  );
421
 
422
- if ( ! $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ) {
423
- $ewd_ufaq_premium_permissions = array(
424
- 'disabled' => true,
425
- 'disabled_image'=> '#',
426
- 'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-faq/'
427
- );
428
- }
429
- else { $ewd_ufaq_premium_permissions = array(); }
430
-
431
  $sap->add_section(
432
  'ewd-ufaq-settings',
433
  array(
434
- 'id' => 'ewd-ufaq-premium-tab',
435
- 'title' => __( 'Premium', 'ultimate-faqs' ),
436
  'is_tab' => true,
437
  )
438
  );
439
 
440
  $sap->add_section(
441
  'ewd-ufaq-settings',
442
- array_merge(
443
- array(
444
- 'id' => 'ewd-ufaq-premium-display',
445
- 'title' => __( 'Display', 'ultimate-faqs' ),
446
- 'tab' => 'ewd-ufaq-premium-tab',
447
- ),
448
- $ewd_ufaq_premium_permissions
449
- )
450
- );
451
-
452
- $sap->add_setting(
453
- 'ewd-ufaq-settings',
454
- 'ewd-ufaq-premium-display',
455
- 'radio',
456
  array(
457
- 'id' => 'display-style',
458
- 'title' => __( 'FAQ Display Style', 'ultimate-faqs' ),
459
- 'description' => __( 'Which theme should be used to display the FAQ\'s?', 'ultimate-faqs' ),
460
- 'options' => array(
461
- 'default' => __( 'Default', 'ultimate-faqs' ),
462
- 'block' => __( 'Block', 'ultimate-faqs' ),
463
- 'border_block' => __( 'Border Block', 'ultimate-faqs' ),
464
- 'contemporary' => __( 'Contemporary', 'ultimate-faqs' ),
465
- 'list' => __( 'List', 'ultimate-faqs' ),
466
- 'minimalist' => __( 'Minimalist', 'ultimate-faqs' ),
467
- ),
468
- 'default' => $this->defaults['display-style']
469
  )
470
  );
471
 
472
  $sap->add_setting(
473
  'ewd-ufaq-settings',
474
- 'ewd-ufaq-premium-display',
475
- 'radio',
476
  array(
477
- 'id' => 'number-of-columns',
478
- 'title' => __( 'Number of Columns', 'ultimate-faqs' ),
479
- 'description' => __( 'In how many columns would you like your FAQs displayed?', 'ultimate-faqs' ),
480
- 'options' => array(
481
- 'one' => __( 'One', 'ultimate-faqs' ),
482
- 'two' => __( 'Two', 'ultimate-faqs' ),
483
- 'three' => __( 'Three', 'ultimate-faqs' ),
484
- 'four' => __( 'Four', 'ultimate-faqs' ),
485
- ),
486
- 'default' => $this->defaults['number-of-columns']
487
  )
488
  );
489
 
490
  $sap->add_setting(
491
  'ewd-ufaq-settings',
492
- 'ewd-ufaq-premium-display',
493
  'toggle',
494
  array(
495
- 'id' => 'responsive-columns',
496
- 'title' => __( 'Responsive Columns', 'ultimate-faqs' ),
497
- 'description' => __( 'If you have more than one column, would you like them to be responsive? If this option is disabled, the number of columns will remain the same on all screen sizes.', 'ultimate-faqs' )
 
 
498
  )
499
- );
500
 
501
  $sap->add_setting(
502
  'ewd-ufaq-settings',
503
- 'ewd-ufaq-premium-display',
504
  'select',
505
  array(
506
- 'id' => 'reveal-effect',
507
- 'title' => __( 'Reveal Effect', 'ultimate-faqs' ),
508
- 'description' => __( 'How should FAQ\'s be displayed when their titles are clicked?', 'ultimate-faqs' ),
509
  'blank_option' => false,
510
  'options' => array(
511
- 'none' => __( 'None', 'ultimate-faqs' ),
512
- 'blind' => __( 'Blind', 'ultimate-faqs' ),
513
- 'bounce' => __( 'Bounce', 'ultimate-faqs' ),
514
- 'clip' => __( 'Clip', 'ultimate-faqs' ),
515
- 'drop' => __( 'Drop', 'ultimate-faqs' ),
516
- 'explode' => __( 'Explode', 'ultimate-faqs' ),
517
- 'fade' => __( 'Fade', 'ultimate-faqs' ),
518
- 'fold' => __( 'Fold', 'ultimate-faqs' ),
519
- 'highlight' => __( 'Highlight', 'ultimate-faqs' ),
520
- 'puff' => __( 'Puff', 'ultimate-faqs' ),
521
- 'pulsate' => __( 'Pulsate', 'ultimate-faqs' ),
522
- 'shake' => __( 'Shake', 'ultimate-faqs' ),
523
- 'size' => __( 'Size', 'ultimate-faqs' ),
524
- 'slide' => __( 'Slide', 'ultimate-faqs' ),
525
- )
526
- )
527
- );
528
-
529
- $sap->add_setting(
530
- 'ewd-ufaq-settings',
531
- 'ewd-ufaq-premium-display',
532
- 'text',
533
- array(
534
- 'id' => 'faqs-per-page',
535
- 'title' => __( 'FAQs Per Page', 'ultimate-faqs' ),
536
- 'description' => __( 'How many FAQs should be displayed on each page? (Leave blank to display all FAQs)', 'ultimate-faqs' ),
537
- 'small' => true
538
- )
539
- );
540
-
541
- $sap->add_setting(
542
- 'ewd-ufaq-settings',
543
- 'ewd-ufaq-premium-display',
544
- 'radio',
545
- array(
546
- 'id' => 'page-type',
547
- 'title' => __( 'FAQ Page Type', 'ultimate-faqs' ),
548
- 'description' => __( 'If FAQs are in pages, how should pages load?', 'ultimate-faqs' ),
549
- 'options' => array(
550
- 'distinct' => __( 'Distinct Pages', 'ultimate-faqs' ),
551
- 'load_more' => __( 'Load More Button', 'ultimate-faqs' ),
552
- 'infinite_scroll' => __( 'Infinite Scroll', 'ultimate-faqs' )
553
- ),
554
- 'default' => $this->defaults['page-type']
555
- )
556
- );
557
-
558
- $sap->add_section(
559
- 'ewd-ufaq-settings',
560
- array_merge(
561
- array(
562
- 'id' => 'ewd-ufaq-premium-general',
563
- 'title' => __( 'General', 'ultimate-faqs' ),
564
- 'tab' => 'ewd-ufaq-premium-tab',
565
  ),
566
- $ewd_ufaq_premium_permissions
567
- )
568
- );
569
-
570
- $sap->add_setting(
571
- 'ewd-ufaq-settings',
572
- 'ewd-ufaq-premium-general',
573
- 'toggle',
574
- array(
575
- 'id' => 'faq-ratings',
576
- 'title' => __( 'FAQ Ratings', 'ultimate-faqs' ),
577
- 'description' => __( 'Should visitors be able to up or down vote FAQs to let others know if they found them helpful?', 'ultimate-faqs' )
578
- )
579
- );
580
-
581
- $sap->add_setting(
582
- 'ewd-ufaq-settings',
583
- 'ewd-ufaq-premium-general',
584
- 'file-upload',
585
- array(
586
- 'id' => 'thumbs-up-image',
587
- 'title' => __( 'FAQ Ratings \'Thumbs Up\' Image', 'ultimate-faqs' ),
588
- 'description' => __( 'You can use this to upload your own image to replace the default "thumbs up" image.', 'ultimate-faqs' ),
589
- 'conditional_on' => 'faq-ratings',
590
- 'conditional_on_value' => true
591
- )
592
- );
593
-
594
- $sap->add_setting(
595
- 'ewd-ufaq-settings',
596
- 'ewd-ufaq-premium-general',
597
- 'file-upload',
598
- array(
599
- 'id' => 'thumbs-down-image',
600
- 'title' => __( 'FAQ Ratings \'Thumbs Down\' Image', 'ultimate-faqs' ),
601
- 'description' => __( 'You can use this to upload your own image to replace the default "thumbs down" image.', 'ultimate-faqs' ),
602
- 'conditional_on' => 'faq-ratings',
603
- 'conditional_on_value' => true
604
- )
605
- );
606
-
607
- $sap->add_setting(
608
- 'ewd-ufaq-settings',
609
- 'ewd-ufaq-premium-general',
610
- 'toggle',
611
- array(
612
- 'id' => 'pretty-permalinks',
613
- 'title' => __( 'Pretty Permalinks', 'ultimate-faqs' ),
614
- 'description' => __( 'Should an SEO friendly permalink structure be used for the link to the FAQ?', 'ultimate-faqs' )
615
- )
616
- );
617
-
618
- $sap->add_setting(
619
- 'ewd-ufaq-settings',
620
- 'ewd-ufaq-premium-general',
621
- 'toggle',
622
- array(
623
- 'id' => 'disable-homepage-canoncial-redirect',
624
- 'title' => __( 'Disable Front-Page Canonical Redirects', 'ultimate-faqs' ),
625
- 'description' => __( 'Should canonical redirects be disabled for the front page of your site? Only necessary if you\'re using the plugin on your homepage and have pretty permalinks enabled.', 'ultimate-faqs' ),
626
- 'conditional_on' => 'pretty-permalinks',
627
  'conditional_on_value' => true
628
  )
629
  );
630
 
631
  $sap->add_setting(
632
  'ewd-ufaq-settings',
633
- 'ewd-ufaq-premium-general',
634
- 'toggle',
635
- array(
636
- 'id' => 'auto-complete-titles',
637
- 'title' => __( 'FAQ Auto Complete Titles', 'ultimate-faqs' ),
638
- 'description' => __( 'Should the FAQ Titles auto complete when using the FAQ search shortcode?', 'ultimate-faqs' )
639
- )
640
- );
641
-
642
- $sap->add_setting(
643
- 'ewd-ufaq-settings',
644
- 'ewd-ufaq-premium-general',
645
- 'text',
646
- array(
647
- 'id' => 'slug-base',
648
- 'title' => __( 'FAQ Slug Base', 'ultimate-faqs' ),
649
- 'description' => __( 'This option can be used to change the slug base for all FAQ posts. Be sure to go to "Settings" -> "Permalinks" in the WordPress sidebar and hit "Save Changes" to avoid 404 errors.', 'ultimate-faqs' ),
650
- 'small' => true
651
- )
652
- );
653
-
654
- $sap->add_setting(
655
- 'ewd-ufaq-settings',
656
- 'ewd-ufaq-premium-general',
657
- 'checkbox',
658
  array(
659
- 'id' => 'social-media',
660
- 'title' => __( 'Social Media Options', 'ultimate-faqs' ),
661
- 'description' => '',
662
  'options' => array(
663
- 'facebook' => 'Facebook',
664
- 'twitter' => 'Twitter',
665
- 'linkedin' => 'LinkedIn',
666
- 'pinterest' => 'Pinterest',
667
- 'email' => 'Email',
668
- )
669
- )
670
- );
671
-
672
- $sap->add_section(
673
- 'ewd-ufaq-settings',
674
- array_merge(
675
- array(
676
- 'id' => 'ewd-ufaq-woocommerce',
677
- 'title' => __( 'WooCommerce', 'ultimate-faqs' ),
678
- 'tab' => 'ewd-ufaq-premium-tab',
679
  ),
680
- $ewd_ufaq_premium_permissions
681
- )
682
- );
683
-
684
- $sap->add_setting(
685
- 'ewd-ufaq-settings',
686
- 'ewd-ufaq-woocommerce',
687
- 'toggle',
688
- array(
689
- 'id' => 'woocommerce-faqs',
690
- 'title' => __( 'WooCommerce FAQs', 'ultimate-faqs' ),
691
- 'description' => __( 'Should FAQs for a given product be displayed as an extra tab on the WooCommerce product page? For this to work correctly, an FAQ category needs to be created with the same name as a given WooCommerce product.', 'ultimate-faqs' )
692
- )
693
- );
694
-
695
- $sap->add_setting(
696
- 'ewd-ufaq-settings',
697
- 'ewd-ufaq-woocommerce',
698
- 'toggle',
699
- array(
700
- 'id' => 'woocommerce-use-product',
701
- 'title' => __( 'Use WooCommerce Product Object', 'ultimate-faqs' ),
702
- 'description' => __( 'Should the FAQ tab be set up using the WooCommerce product object, as in the WC documentation, or just using the ID of the page?', 'ultimate-faqs' ),
703
- 'conditional_on' => 'woocommerce-faqs',
704
  'conditional_on_value' => true
705
  )
706
  );
707
 
708
- $sap->add_section(
709
- 'ewd-ufaq-settings',
710
- array_merge(
711
- array(
712
- 'id' => 'ewd-ufaq-wpforms-integration',
713
- 'title' => __( 'WP Forms', 'ultimate-faqs' ),
714
- 'tab' => 'ewd-ufaq-premium-tab',
715
- ),
716
- $ewd_ufaq_premium_permissions
717
- )
718
- );
719
-
720
- $sap->add_setting(
721
- 'ewd-ufaq-settings',
722
- 'ewd-ufaq-wpforms-integration',
723
- 'toggle',
724
- array(
725
- 'id' => 'wpforms-integration',
726
- 'title' => __( 'WP Forms Integration', 'ultimate-faqs' ),
727
- 'description' => __( 'Should FAQs be displayed when a visitor starts typing a message into a paragraph text field in WP Forms? This can be turned off for specific forms via the form\'s settings panel.', 'ultimate-faqs' )
728
- )
729
- );
730
-
731
  $sap->add_setting(
732
  'ewd-ufaq-settings',
733
- 'ewd-ufaq-wpforms-integration',
734
- 'text',
735
  array(
736
- 'id' => 'wpforms-post-count',
737
- 'title' => __( 'WP Forms Post Count', 'ultimate-faqs' ),
738
- 'description' => __( 'How many posts should be displayed below paragraph text fields, if WP Forms Integration has been turned on?', 'ultimate-faqs' ),
739
- 'small' => true,
740
- 'conditional_on' => 'wpforms-integration',
741
- 'conditional_on_value' => true
 
 
 
 
 
742
  )
743
  );
744
 
745
  $sap->add_setting(
746
  'ewd-ufaq-settings',
747
- 'ewd-ufaq-wpforms-integration',
748
  'radio',
749
  array(
750
- 'id' => 'wpforms-faq-location',
751
- 'title' => __( 'WP Forms FAQ Location', 'ultimate-faqs' ),
752
- 'description' => __( 'If WP Forms Integration has been turned on, where should the FAQs be displayed?', 'ultimate-faqs' ),
753
  'options' => array(
754
- 'above' => __( 'Above', 'ultimate-faqs' ),
755
- 'below' => __( 'Below', 'ultimate-faqs' ),
756
- ),
757
- 'default' => $this->defaults['wpforms-faq-location'],
758
- 'conditional_on' => 'wpforms-integration',
759
- 'conditional_on_value' => true
760
- )
761
- );
762
-
763
- $sap->add_section(
764
- 'ewd-ufaq-settings',
765
- array_merge(
766
- array(
767
- 'id' => 'ewd-ufaq-submit-faq',
768
- 'title' => __( 'Submit FAQ', 'ultimate-faqs' ),
769
- 'tab' => 'ewd-ufaq-premium-tab',
770
  ),
771
- $ewd_ufaq_premium_permissions
772
- )
773
- );
774
-
775
- $sap->add_setting(
776
- 'ewd-ufaq-settings',
777
- 'ewd-ufaq-submit-faq',
778
- 'toggle',
779
- array(
780
- 'id' => 'allow-proposed-answer',
781
- 'title' => __( 'Allow Proposed Answer', 'ultimate-faqs' ),
782
- 'description' => __( 'When using the user-submitted question shortcode, should users be able to propose an answer to the question they\'re submitting?', 'ultimate-faqs' )
783
- )
784
- );
785
-
786
- $sap->add_setting(
787
- 'ewd-ufaq-settings',
788
- 'ewd-ufaq-submit-faq',
789
- 'toggle',
790
- array(
791
- 'id' => 'submit-custom-fields',
792
- 'title' => __( 'Submit Custom Fields', 'ultimate-faqs' ),
793
- 'description' => __( 'When using the user-submitted question shortcode, should users be able to fill in custom fields for the question they\'re submitting? File type custom fields cannot be submitted for security reasons.', 'ultimate-faqs' )
794
- )
795
- );
796
-
797
- $sap->add_setting(
798
- 'ewd-ufaq-settings',
799
- 'ewd-ufaq-submit-faq',
800
- 'toggle',
801
- array(
802
- 'id' => 'submit-question-captcha',
803
- 'title' => __( 'Submit Question Captcha', 'ultimate-faqs' ),
804
- 'description' => __( 'When using the user-submitted question shortcode, should a captcha field be added to the form to reduce the volume of spam FAQs?', 'ultimate-faqs' )
805
  )
806
  );
807
 
808
- $args = array(
809
- 'hide_empty' => false,
810
- 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY
811
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
 
813
- $categories = get_terms( $args );
814
 
815
- $category_options = array();
816
 
817
- foreach ( $categories as $category ) {
 
818
 
819
- $category_options[ $category->slug ] = $category->name;
 
820
  }
821
 
822
- $sap->add_setting(
823
- 'ewd-ufaq-settings',
824
- 'ewd-ufaq-submit-faq',
825
- 'select',
826
- array(
827
- 'id' => 'submitted-default-category',
828
- 'title' => __( 'Default Category', 'ultimate-faqs' ),
829
- 'description' => __( 'Which category should submitted questions default to?', 'ultimate-faqs' ),
830
- 'blank_option' => true,
831
- 'options' => $category_options
832
- )
833
- );
834
-
835
- $sap->add_setting(
836
- 'ewd-ufaq-settings',
837
- 'ewd-ufaq-submit-faq',
838
- 'toggle',
839
- array(
840
- 'id' => 'admin-question-notification',
841
- 'title' => __( 'Admin Question Notification', 'ultimate-faqs' ),
842
- 'description' => __( 'Should an email be sent to the site administrator when a question is submitted?', 'ultimate-faqs' )
843
- )
844
- );
845
 
846
- $sap->add_setting(
847
- 'ewd-ufaq-settings',
848
- 'ewd-ufaq-submit-faq',
849
- 'text',
850
- array(
851
- 'id' => 'admin-notification-email',
852
- 'title' => __( 'Admin Notification Email', 'ultimate-faqs' ),
853
- 'description' => __( 'What email address should the notifications be sent to if "Admin Question Notification" is enabled above? If blank, the default WordPress admin email will be used.', 'ultimate-faqs' ),
854
- 'small' => true,
855
- 'conditional_on' => 'admin-question-notification',
856
- 'conditional_on_value' => true
857
- )
858
- );
859
 
860
- $emails = array();
861
- if ( post_type_exists( 'uwpm_mail_template' ) ) {
862
 
863
- $email_posts = get_posts( array( 'post_type' => 'uwpm_mail_template', 'posts_per_page' => -1 ) );
864
- foreach ( $email_posts as $email_post ) { $emails[$email_post->ID ] = $email_post->post_title; }
865
  }
866
-
867
- $sap->add_setting(
868
- 'ewd-ufaq-settings',
869
- 'ewd-ufaq-submit-faq',
870
- 'select',
871
- array(
872
- 'id' => 'submit-faq-email',
873
- 'title' => __( 'FAQ Submitted Thank You E-mail', 'ultimate-faqs' ),
874
- 'description' => __( 'You can use the <a href="https://wordpress.org/plugins/ultimate-wp-mail/">Ultimate WP Mail plugin</a> to create a custom email that is sent whenever an faq is submitted.', 'ultimate-faqs' ),
875
- 'blank_option' => true,
876
- 'options' => $emails
877
- )
878
- );
879
-
880
- $sap->add_section(
881
- 'ewd-ufaq-settings',
882
- array_merge(
883
- array(
884
- 'id' => 'ewd-ufaq-faq-elements-order',
885
- 'title' => __( 'FAQ Elements Order', 'ultimate-faqs' ),
886
- 'tab' => 'ewd-ufaq-premium-tab',
887
- ),
888
- $ewd_ufaq_premium_permissions
889
- )
890
- );
891
-
892
- $sap->add_setting(
893
- 'ewd-ufaq-settings',
894
- 'ewd-ufaq-faq-elements-order',
895
- 'ordering-table',
896
- array(
897
- 'id' => 'faq-elements-order',
898
- 'title' => __( 'FAQ Elements Order', 'ultimate-faqs' ),
899
- 'description' => __( 'You can use this table to drag-and-drop the elements of an FAQ into a different order.', 'ultimate-faqs' ),
900
- 'items' => $this->get_setting( 'faq-elements-order' )
901
- )
902
- );
903
-
904
- $sap->add_section(
905
- 'ewd-ufaq-settings',
906
- array(
907
- 'id' => 'ewd-ufaq-ordering-tab',
908
- 'title' => __( 'Ordering', 'ultimate-faqs' ),
909
- 'is_tab' => true,
910
- )
911
- );
912
 
913
- $sap->add_section(
914
- 'ewd-ufaq-settings',
915
- array(
916
- 'id' => 'ewd-ufaq-ordering-settings',
917
- 'title' => __( 'Settings', 'ultimate-faqs' ),
918
- 'tab' => 'ewd-ufaq-ordering-tab',
919
- )
920
- );
921
-
922
- $sap->add_setting(
923
- 'ewd-ufaq-settings',
924
- 'ewd-ufaq-ordering-settings',
925
- 'toggle',
926
- array(
927
- 'id' => 'group-by-category',
928
- 'title' => __( 'Group FAQs by Category', 'ultimate-faqs' ),
929
- 'description' => __( 'Should FAQs be grouped by category, or should all categories be mixed together?', 'ultimate-faqs' )
930
- )
931
- );
932
-
933
- $sap->add_setting(
934
- 'ewd-ufaq-settings',
935
- 'ewd-ufaq-ordering-settings',
936
- 'toggle',
937
- array(
938
- 'id' => 'group-by-category-count',
939
- 'title' => __( 'Display FAQ Category Count', 'ultimate-faqs' ),
940
- 'description' => __( 'If FAQs are grouped by category, should the number of FAQs in a category be displayed beside the category name?', 'ultimate-faqs' ),
941
- 'conditional_on' => 'group-by-category',
942
- 'conditional_on_value' => true
943
- )
944
- );
945
-
946
- $sap->add_setting(
947
- 'ewd-ufaq-settings',
948
- 'ewd-ufaq-ordering-settings',
949
- 'select',
950
- array(
951
- 'id' => 'category-order-by',
952
- 'title' => __( 'Sort Categories', 'ultimate-faqs' ),
953
- 'description' => __( 'How should FAQ categories be ordered? (Only used if "Group FAQs by Category" above is enabled.)', 'ultimate-faqs' ),
954
- 'blank_option' => false,
955
- 'options' => array(
956
- 'name' => __( 'Name', 'ultimate-faqs' ),
957
- 'count' => __( 'FAQ Count', 'ultimate-faqs' ),
958
- 'slug' => __( 'Slug', 'ultimate-faqs' ),
959
- ),
960
- 'conditional_on' => 'group-by-category',
961
- 'conditional_on_value' => true
962
- )
963
- );
964
-
965
- $sap->add_setting(
966
- 'ewd-ufaq-settings',
967
- 'ewd-ufaq-ordering-settings',
968
- 'radio',
969
- array(
970
- 'id' => 'category-order',
971
- 'title' => __( 'Sort Categories Ordering', 'ultimate-faqs' ),
972
- 'description' => __( 'How should FAQ categories be ordered? (Only used if "Group FAQs by Category" above is enabled.)', 'ultimate-faqs' ),
973
- 'options' => array(
974
- 'asc' => __( 'Ascending', 'ultimate-faqs' ),
975
- 'desc' => __( 'Descending', 'ultimate-faqs' ),
976
- ),
977
- 'default' => $this->defaults['category-order'],
978
- 'conditional_on' => 'group-by-category',
979
- 'conditional_on_value' => true
980
- )
981
- );
982
-
983
- $sap->add_setting(
984
- 'ewd-ufaq-settings',
985
- 'ewd-ufaq-ordering-settings',
986
- 'radio',
987
- array(
988
- 'id' => 'faq-order-by',
989
- 'title' => __( 'FAQ Ordering', 'ultimate-faqs' ),
990
- 'description' => __( 'How should individual FAQs be ordered?', 'ultimate-faqs' ),
991
- 'blank_option' => false,
992
- 'options' => array(
993
- 'date' => __( 'Created Date', 'ultimate-faqs' ),
994
- 'title' => __( 'Title', 'ultimate-faqs' ),
995
- 'modified' => __( 'Modified Date', 'ultimate-faqs' ),
996
- 'set_order' => __( 'Selected Order (Premium option)', 'ultimate-faqs' ),
997
- ),
998
- 'default' => $this->defaults['faq-order-by']
999
- )
1000
- );
1001
-
1002
- $sap->add_setting(
1003
- 'ewd-ufaq-settings',
1004
- 'ewd-ufaq-ordering-settings',
1005
- 'radio',
1006
- array(
1007
- 'id' => 'faq-order',
1008
- 'title' => __( 'Sort FAQs Ordering', 'ultimate-faqs' ),
1009
- 'description' => __( 'Should FAQ be ascending or descending order, based on the ordering criteria above?', 'ultimate-faqs' ),
1010
- 'options' => array(
1011
- 'asc' => __( 'Ascending', 'ultimate-faqs' ),
1012
- 'desc' => __( 'Descending', 'ultimate-faqs' ),
1013
- ),
1014
- 'default' => $this->defaults['faq-order']
1015
- )
1016
- );
1017
-
1018
- if ( ! $ewd_ufaq_controller->permissions->check_permission( 'fields' ) ) {
1019
- $ewd_ufaq_fields_permissions = array(
1020
- 'disabled' => true,
1021
- 'disabled_image'=> '#',
1022
- 'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-faq/'
1023
- );
1024
- }
1025
- else { $ewd_ufaq_fields_permissions = array(); }
1026
-
1027
- $sap->add_section(
1028
- 'ewd-ufaq-settings',
1029
- array(
1030
- 'id' => 'ewd-ufaq-fields-tab',
1031
- 'title' => __( 'Fields', 'ultimate-faqs' ),
1032
- 'is_tab' => true,
1033
- )
1034
- );
1035
-
1036
- $sap->add_section(
1037
- 'ewd-ufaq-settings',
1038
- array_merge(
1039
- array(
1040
- 'id' => 'ewd-ufaq-fields-settings',
1041
- 'title' => __( 'Settings', 'ultimate-faqs' ),
1042
- 'tab' => 'ewd-ufaq-fields-tab',
1043
- ),
1044
- $ewd_ufaq_fields_permissions
1045
- )
1046
- );
1047
-
1048
- $sap->add_setting(
1049
- 'ewd-ufaq-settings',
1050
- 'ewd-ufaq-fields-settings',
1051
- 'toggle',
1052
- array(
1053
- 'id' => 'hide-blank-fields',
1054
- 'title' => __( 'Hide Blank Fields', 'ultimate-faqs' ),
1055
- 'description' => __( 'Should field labels be hidden if a field hasn\'t been filled out for a particular FAQ?', 'ultimate-faqs' )
1056
- )
1057
- );
1058
-
1059
- $fields_description = __( 'Should any extra fields be added to the FAQs?', 'ultimate-faqs' ) . '<br />';
1060
- $fields_description .= __( 'The "Field Values" should be a comma-separated list of values for the select, radio or checkbox field types (no extra spaces after the comma).', 'ultimate-faqs' ) . '<br />';
1061
- $fields_description .= __( 'For security reasons, file fields cannot be included in the submit FAQ form.', 'ultimate-faqs' ) . '<br />';
1062
-
1063
- $sap->add_setting(
1064
- 'ewd-ufaq-settings',
1065
- 'ewd-ufaq-fields-settings',
1066
- 'infinite_table',
1067
- array(
1068
- 'id' => 'faq-fields',
1069
- 'title' => __( 'FAQ Custom Fields', 'ultimate-faqs' ),
1070
- 'add_label' => __( '&plus; ADD', 'ultimate-faqs' ),
1071
- 'del_label' => __( 'Delete', 'ultimate-faqs' ),
1072
- 'description' => $fields_description,
1073
- 'fields' => array(
1074
- 'id' => array(
1075
- 'type' => 'hidden',
1076
- 'label' => 'Field ID',
1077
- 'required' => true
1078
- ),
1079
- 'name' => array(
1080
- 'type' => 'text',
1081
- 'label' => 'Field Name',
1082
- 'required' => true
1083
- ),
1084
- 'type' => array(
1085
- 'type' => 'select',
1086
- 'label' => __( 'Field Type', 'ultimate-faqs' ),
1087
- 'options' => array(
1088
- 'text' => __( 'Text', 'ultimate-faqs' ),
1089
- 'textarea' => __( 'Text Area', 'ultimate-faqs' ),
1090
- 'select' => __( 'Select Box', 'ultimate-faqs' ),
1091
- 'radio' => __( 'Radio Buttons', 'ultimate-faqs' ),
1092
- 'checkbox' => __( 'Checkbox', 'ultimate-faqs' ),
1093
- 'file' => __( 'File', 'ultimate-faqs' ),
1094
- 'link' => __( 'Link', 'ultimate-faqs' ),
1095
- 'date' => __( 'Date', 'ultimate-faqs' ),
1096
- 'datetime' => __( 'Date/Time', 'ultimate-faqs' ),
1097
- )
1098
- ),
1099
- 'options' => array(
1100
- 'type' => 'text',
1101
- 'label' => __( 'Field Values', 'ultimate-faqs' ),
1102
- 'required' => false
1103
- )
1104
- )
1105
- )
1106
- );
1107
-
1108
- if ( ! $ewd_ufaq_controller->permissions->check_permission( 'labelling' ) ) {
1109
- $ewd_ufaq_labelling_permissions = array(
1110
- 'disabled' => true,
1111
- 'disabled_image'=> '#',
1112
- 'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-faq/'
1113
- );
1114
  }
1115
- else { $ewd_ufaq_labelling_permissions = array(); }
1116
-
1117
- $sap->add_section(
1118
- 'ewd-ufaq-settings',
1119
- array(
1120
- 'id' => 'ewd-ufaq-labelling-tab',
1121
- 'title' => __( 'Labelling', 'ultimate-faqs' ),
1122
- 'is_tab' => true,
1123
- )
1124
- );
1125
-
1126
- $sap->add_section(
1127
- 'ewd-ufaq-settings',
1128
- array_merge(
1129
- array(
1130
- 'id' => 'ewd-ufaq-labelling-faq-and-search',
1131
- 'title' => __( 'FAQ Page and Search', 'ultimate-faqs' ),
1132
- 'tab' => 'ewd-ufaq-labelling-tab',
1133
- ),
1134
- $ewd_ufaq_labelling_permissions
1135
- )
1136
- );
1137
-
1138
- $sap->add_setting(
1139
- 'ewd-ufaq-settings',
1140
- 'ewd-ufaq-labelling-faq-and-search',
1141
- 'text',
1142
- array(
1143
- 'id' => 'label-posted',
1144
- 'title' => __( 'Posted', 'ultimate-faqs' ),
1145
- 'description' => ''
1146
- )
1147
- );
1148
-
1149
- $sap->add_setting(
1150
- 'ewd-ufaq-settings',
1151
- 'ewd-ufaq-labelling-faq-and-search',
1152
- 'text',
1153
- array(
1154
- 'id' => 'label-by',
1155
- 'title' => __( 'By', 'ultimate-faqs' ),
1156
- 'description' => ''
1157
- )
1158
- );
1159
-
1160
- $sap->add_setting(
1161
- 'ewd-ufaq-settings',
1162
- 'ewd-ufaq-labelling-faq-and-search',
1163
- 'text',
1164
- array(
1165
- 'id' => 'label-on',
1166
- 'title' => __( 'On', 'ultimate-faqs' ),
1167
- 'description' => ''
1168
- )
1169
- );
1170
-
1171
- $sap->add_setting(
1172
- 'ewd-ufaq-settings',
1173
- 'ewd-ufaq-labelling-faq-and-search',
1174
- 'text',
1175
- array(
1176
- 'id' => 'label-categories',
1177
- 'title' => __( 'Categories', 'ultimate-faqs' ),
1178
- 'description' => ''
1179
- )
1180
- );
1181
-
1182
- $sap->add_setting(
1183
- 'ewd-ufaq-settings',
1184
- 'ewd-ufaq-labelling-faq-and-search',
1185
- 'text',
1186
- array(
1187
- 'id' => 'label-tags',
1188
- 'title' => __( 'Tags', 'ultimate-faqs' ),
1189
- 'description' => ''
1190
- )
1191
- );
1192
-
1193
- $sap->add_setting(
1194
- 'ewd-ufaq-settings',
1195
- 'ewd-ufaq-labelling-faq-and-search',
1196
- 'text',
1197
- array(
1198
- 'id' => 'label-permalink',
1199
- 'title' => __( 'Permalink', 'ultimate-faqs' ),
1200
- 'description' => ''
1201
- )
1202
- );
1203
-
1204
- $sap->add_setting(
1205
- 'ewd-ufaq-settings',
1206
- 'ewd-ufaq-labelling-faq-and-search',
1207
- 'text',
1208
- array(
1209
- 'id' => 'label-back-to-top',
1210
- 'title' => __( 'Back To Top', 'ultimate-faqs' ),
1211
- 'description' => ''
1212
- )
1213
- );
1214
-
1215
- $sap->add_setting(
1216
- 'ewd-ufaq-settings',
1217
- 'ewd-ufaq-labelling-faq-and-search',
1218
- 'text',
1219
- array(
1220
- 'id' => 'label-woocommerce-tab',
1221
- 'title' => __( 'WooCommerce Tab', 'ultimate-faqs' ),
1222
- 'description' => ''
1223
- )
1224
- );
1225
-
1226
- $sap->add_setting(
1227
- 'ewd-ufaq-settings',
1228
- 'ewd-ufaq-labelling-faq-and-search',
1229
- 'text',
1230
- array(
1231
- 'id' => 'label-share-faq',
1232
- 'title' => __( 'Share', 'ultimate-faqs' ),
1233
- 'description' => ''
1234
- )
1235
- );
1236
-
1237
- $sap->add_setting(
1238
- 'ewd-ufaq-settings',
1239
- 'ewd-ufaq-labelling-faq-and-search',
1240
- 'text',
1241
- array(
1242
- 'id' => 'label-find-faq-helpful',
1243
- 'title' => __( 'Did you find this FAQ helpful?', 'ultimate-faqs' ),
1244
- 'description' => ''
1245
- )
1246
- );
1247
-
1248
- $sap->add_setting(
1249
- 'ewd-ufaq-settings',
1250
- 'ewd-ufaq-labelling-faq-and-search',
1251
- 'text',
1252
- array(
1253
- 'id' => 'label-enter-question',
1254
- 'title' => __( 'Enter your question', 'ultimate-faqs' ),
1255
- 'description' => ''
1256
- )
1257
- );
1258
-
1259
- $sap->add_setting(
1260
- 'ewd-ufaq-settings',
1261
- 'ewd-ufaq-labelling-faq-and-search',
1262
- 'text',
1263
- array(
1264
- 'id' => 'label-search-placeholder',
1265
- 'title' => __( 'Search Placeholder', 'ultimate-faqs' ),
1266
- 'description' => ''
1267
- )
1268
- );
1269
-
1270
- $sap->add_setting(
1271
- 'ewd-ufaq-settings',
1272
- 'ewd-ufaq-labelling-faq-and-search',
1273
- 'text',
1274
- array(
1275
- 'id' => 'label-search',
1276
- 'title' => __( 'Search Button', 'ultimate-faqs' ),
1277
- 'description' => ''
1278
- )
1279
- );
1280
-
1281
- $sap->add_setting(
1282
- 'ewd-ufaq-settings',
1283
- 'ewd-ufaq-labelling-faq-and-search',
1284
- 'text',
1285
- array(
1286
- 'id' => 'label-retrieving-results',
1287
- 'title' => __( 'Retrieving Results', 'ultimate-faqs' ),
1288
- 'description' => ''
1289
- )
1290
- );
1291
-
1292
- $sap->add_setting(
1293
- 'ewd-ufaq-settings',
1294
- 'ewd-ufaq-labelling-faq-and-search',
1295
- 'text',
1296
- array(
1297
- 'id' => 'label-no-results-found',
1298
- 'title' => __( 'No result FAQ\'s contained the term \'%s\'', 'ultimate-faqs' ),
1299
- 'description' => ''
1300
- )
1301
- );
1302
-
1303
- $sap->add_section(
1304
- 'ewd-ufaq-settings',
1305
- array_merge(
1306
- array(
1307
- 'id' => 'ewd-ufaq-labelling-faq-submit-page',
1308
- 'title' => __( 'FAQ Submit Page', 'ultimate-faqs' ),
1309
- 'tab' => 'ewd-ufaq-labelling-tab',
1310
- ),
1311
- $ewd_ufaq_labelling_permissions
1312
- )
1313
- );
1314
-
1315
- $sap->add_setting(
1316
- 'ewd-ufaq-settings',
1317
- 'ewd-ufaq-labelling-faq-submit-page',
1318
- 'text',
1319
- array(
1320
- 'id' => 'label-thank-you-submit',
1321
- 'title' => __( 'Thank you for submitting an FAQ', 'ultimate-faqs' ),
1322
- 'description' => ''
1323
- )
1324
- );
1325
-
1326
- $sap->add_setting(
1327
- 'ewd-ufaq-settings',
1328
- 'ewd-ufaq-labelling-faq-submit-page',
1329
- 'text',
1330
- array(
1331
- 'id' => 'label-submit-question',
1332
- 'title' => __( 'Submit a Question', 'ultimate-faqs' ),
1333
- 'description' => ''
1334
- )
1335
- );
1336
-
1337
- $sap->add_setting(
1338
- 'ewd-ufaq-settings',
1339
- 'ewd-ufaq-labelling-faq-submit-page',
1340
- 'text',
1341
- array(
1342
- 'id' => 'label-please-fill-form-below',
1343
- 'title' => __( 'Please fill out the form below to submit a question.', 'ultimate-faqs' ),
1344
- 'description' => ''
1345
- )
1346
- );
1347
-
1348
- $sap->add_setting(
1349
- 'ewd-ufaq-settings',
1350
- 'ewd-ufaq-labelling-faq-submit-page',
1351
- 'text',
1352
- array(
1353
- 'id' => 'label-send-question',
1354
- 'title' => __( 'Send Question', 'ultimate-faqs' ),
1355
- 'description' => ''
1356
- )
1357
- );
1358
-
1359
- $sap->add_setting(
1360
- 'ewd-ufaq-settings',
1361
- 'ewd-ufaq-labelling-faq-submit-page',
1362
- 'text',
1363
- array(
1364
- 'id' => 'label-question-title',
1365
- 'title' => __( 'Question Title', 'ultimate-faqs' ),
1366
- 'description' => ''
1367
- )
1368
- );
1369
-
1370
- $sap->add_setting(
1371
- 'ewd-ufaq-settings',
1372
- 'ewd-ufaq-labelling-faq-submit-page',
1373
- 'text',
1374
- array(
1375
- 'id' => 'label-question-title-explanation',
1376
- 'title' => __( 'What question is being answered?', 'ultimate-faqs' ),
1377
- 'description' => ''
1378
- )
1379
- );
1380
-
1381
- $sap->add_setting(
1382
- 'ewd-ufaq-settings',
1383
- 'ewd-ufaq-labelling-faq-submit-page',
1384
- 'text',
1385
- array(
1386
- 'id' => 'label-proposed-answer',
1387
- 'title' => __( 'Proposed Answer', 'ultimate-faqs' ),
1388
- 'description' => ''
1389
- )
1390
- );
1391
-
1392
- $sap->add_setting(
1393
- 'ewd-ufaq-settings',
1394
- 'ewd-ufaq-labelling-faq-submit-page',
1395
- 'text',
1396
- array(
1397
- 'id' => 'label-proposed-answer-explanation',
1398
- 'title' => __( 'What answer should be displayed for this question?', 'ultimate-faqs' ),
1399
- 'description' => ''
1400
- )
1401
- );
1402
-
1403
- $sap->add_setting(
1404
- 'ewd-ufaq-settings',
1405
- 'ewd-ufaq-labelling-faq-submit-page',
1406
- 'text',
1407
- array(
1408
- 'id' => 'label-question-author',
1409
- 'title' => __( 'Question Author', 'ultimate-faqs' ),
1410
- 'description' => ''
1411
- )
1412
- );
1413
-
1414
- $sap->add_setting(
1415
- 'ewd-ufaq-settings',
1416
- 'ewd-ufaq-labelling-faq-submit-page',
1417
- 'text',
1418
- array(
1419
- 'id' => 'label-captcha-image-number',
1420
- 'title' => __( 'Image Number', 'ultimate-faqs' ),
1421
- 'description' => ''
1422
- )
1423
- );
1424
-
1425
- $sap->add_setting(
1426
- 'ewd-ufaq-settings',
1427
- 'ewd-ufaq-labelling-faq-submit-page',
1428
- 'text',
1429
- array(
1430
- 'id' => 'label-question-author-explanation',
1431
- 'title' => __( 'What name should be displayed with your question?', 'ultimate-faqs' ),
1432
- 'description' => ''
1433
- )
1434
- );
1435
-
1436
- if ( ! $ewd_ufaq_controller->permissions->check_permission( 'styling' ) ) {
1437
- $ewd_ufaq_styling_permissions = array(
1438
- 'disabled' => true,
1439
- 'disabled_image'=> '#',
1440
- 'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-faq/'
1441
- );
1442
- }
1443
- else { $ewd_ufaq_styling_permissions = array(); }
1444
-
1445
- $sap->add_section(
1446
- 'ewd-ufaq-settings',
1447
- array(
1448
- 'id' => 'ewd-ufaq-styling-tab',
1449
- 'title' => __( 'Styling', 'ultimate-faqs' ),
1450
- 'is_tab' => true,
1451
- )
1452
- );
1453
-
1454
- $sap->add_section(
1455
- 'ewd-ufaq-settings',
1456
- array_merge(
1457
- array(
1458
- 'id' => 'ewd-ufaq-styling-toggle-symbol',
1459
- 'title' => __( 'Toggle Symbol', 'ultimate-faqs' ),
1460
- 'tab' => 'ewd-ufaq-styling-tab',
1461
- ),
1462
- $ewd_ufaq_styling_permissions
1463
- )
1464
- );
1465
-
1466
- $sap->add_setting(
1467
- 'ewd-ufaq-settings',
1468
- 'ewd-ufaq-styling-toggle-symbol',
1469
- 'radio',
1470
- array(
1471
- 'id' => 'styling-toggle-symbol',
1472
- 'title' => __( 'Toggle Symbol', 'ultimate-lightbox' ),
1473
- 'columns' => '3',
1474
- 'options' => array(
1475
- 'A' => '<span class="ewd-ufaq-toggle-symbol">a A</span>',
1476
- 'B' => '<span class="ewd-ufaq-toggle-symbol">b B</span>',
1477
- 'C' => '<span class="ewd-ufaq-toggle-symbol">c C</span>',
1478
- 'D' => '<span class="ewd-ufaq-toggle-symbol">d D</span>',
1479
- 'E' => '<span class="ewd-ufaq-toggle-symbol">e E</span>',
1480
- 'F' => '<span class="ewd-ufaq-toggle-symbol">f F</span>',
1481
- 'G' => '<span class="ewd-ufaq-toggle-symbol">g G</span>',
1482
- 'H' => '<span class="ewd-ufaq-toggle-symbol">h H</span>',
1483
- 'I' => '<span class="ewd-ufaq-toggle-symbol">i I</span>',
1484
- 'J' => '<span class="ewd-ufaq-toggle-symbol">j J</span>',
1485
- 'K' => '<span class="ewd-ufaq-toggle-symbol">k K</span>',
1486
- 'L' => '<span class="ewd-ufaq-toggle-symbol">l L</span>',
1487
- 'M' => '<span class="ewd-ufaq-toggle-symbol">m M</span>',
1488
- 'N' => '<span class="ewd-ufaq-toggle-symbol">n N</span>',
1489
- 'O' => '<span class="ewd-ufaq-toggle-symbol">o O</span>',
1490
- ),
1491
- 'default' => $this->defaults['styling-toggle-symbol']
1492
- )
1493
- );
1494
-
1495
- $sap->add_setting(
1496
- 'ewd-ufaq-settings',
1497
- 'ewd-ufaq-styling-toggle-symbol',
1498
- 'colorpicker',
1499
- array(
1500
- 'id' => 'styling-toggle-background-color',
1501
- 'title' => __( 'Toggle Background Color', 'ultimate-faqs' )
1502
- )
1503
- );
1504
-
1505
- $sap->add_setting(
1506
- 'ewd-ufaq-settings',
1507
- 'ewd-ufaq-styling-toggle-symbol',
1508
- 'colorpicker',
1509
- array(
1510
- 'id' => 'styling-toggle-font-color',
1511
- 'title' => __( 'Toggle Color', 'ultimate-faqs' )
1512
- )
1513
- );
1514
-
1515
- $sap->add_setting(
1516
- 'ewd-ufaq-settings',
1517
- 'ewd-ufaq-styling-toggle-symbol',
1518
- 'colorpicker',
1519
- array(
1520
- 'id' => 'styling-toggle-border-color',
1521
- 'title' => __( 'Toggle Border Color', 'ultimate-faqs' )
1522
- )
1523
- );
1524
-
1525
- $sap->add_setting(
1526
- 'ewd-ufaq-settings',
1527
- 'ewd-ufaq-styling-toggle-symbol',
1528
- 'text',
1529
- array(
1530
- 'id' => 'styling-toggle-symbol-size',
1531
- 'title' => __( 'Toggle Font Size', 'ultimate-faqs' ),
1532
- 'description' => '',
1533
- 'small' => true
1534
- )
1535
- );
1536
-
1537
- $sap->add_setting(
1538
- 'ewd-ufaq-settings',
1539
- 'ewd-ufaq-styling-toggle-symbol',
1540
- 'text',
1541
- array(
1542
- 'id' => 'styling-toggle-border-size',
1543
- 'title' => __( 'Border Size', 'ultimate-faqs' ),
1544
- 'description' => '',
1545
- 'small' => true
1546
- )
1547
- );
1548
-
1549
- $sap->add_setting(
1550
- 'ewd-ufaq-settings',
1551
- 'ewd-ufaq-styling-toggle-symbol',
1552
- 'text',
1553
- array(
1554
- 'id' => 'styling-toggle-border-radius',
1555
- 'title' => __( 'Border Radius', 'ultimate-faqs' ),
1556
- 'description' => '',
1557
- 'small' => true
1558
- )
1559
- );
1560
-
1561
- $sap->add_section(
1562
- 'ewd-ufaq-settings',
1563
- array_merge(
1564
- array(
1565
- 'id' => 'ewd-ufaq-styling-themes',
1566
- 'title' => __( 'Themes', 'ultimate-faqs' ),
1567
- 'tab' => 'ewd-ufaq-styling-tab',
1568
- ),
1569
- $ewd_ufaq_styling_permissions
1570
- )
1571
- );
1572
-
1573
- $sap->add_setting(
1574
- 'ewd-ufaq-settings',
1575
- 'ewd-ufaq-styling-themes',
1576
- 'colorpicker',
1577
- array(
1578
- 'id' => 'styling-block-background-color',
1579
- 'title' => __( 'Block and Border Block Background Color', 'ultimate-faqs' )
1580
- )
1581
- );
1582
-
1583
- $sap->add_setting(
1584
- 'ewd-ufaq-settings',
1585
- 'ewd-ufaq-styling-themes',
1586
- 'colorpicker',
1587
- array(
1588
- 'id' => 'styling-block-font-color',
1589
- 'title' => __( 'Block and Border Block Hover Font Color', 'ultimate-faqs' )
1590
- )
1591
- );
1592
-
1593
- $sap->add_setting(
1594
- 'ewd-ufaq-settings',
1595
- 'ewd-ufaq-styling-themes',
1596
- 'colorpicker',
1597
- array(
1598
- 'id' => 'styling-list-font-color',
1599
- 'title' => __( 'List Font Color', 'ultimate-faqs' )
1600
- )
1601
- );
1602
-
1603
-
1604
- $sap->add_setting(
1605
- 'ewd-ufaq-settings',
1606
- 'ewd-ufaq-styling-themes',
1607
- 'text',
1608
- array(
1609
- 'id' => 'styling-list-font',
1610
- 'title' => __( 'Font Family', 'ultimate-faqs' ),
1611
- 'description' => '',
1612
- 'small' => true
1613
- )
1614
- );
1615
-
1616
- $sap->add_setting(
1617
- 'ewd-ufaq-settings',
1618
- 'ewd-ufaq-styling-themes',
1619
- 'text',
1620
- array(
1621
- 'id' => 'styling-list-font-size',
1622
- 'title' => __( 'Font Size', 'ultimate-faqs' ),
1623
- 'description' => '',
1624
- 'small' => true
1625
- )
1626
- );
1627
-
1628
- $sap->add_setting(
1629
- 'ewd-ufaq-settings',
1630
- 'ewd-ufaq-styling-themes',
1631
- 'text',
1632
- array(
1633
- 'id' => 'styling-list-margin',
1634
- 'title' => __( 'Margin', 'ultimate-faqs' ),
1635
- 'description' => '',
1636
- 'small' => true
1637
- )
1638
- );
1639
-
1640
- $sap->add_setting(
1641
- 'ewd-ufaq-settings',
1642
- 'ewd-ufaq-styling-themes',
1643
- 'text',
1644
- array(
1645
- 'id' => 'styling-list-padding',
1646
- 'title' => __( 'Padding', 'ultimate-faqs' ),
1647
- 'description' => '',
1648
- 'small' => true
1649
- )
1650
- );
1651
-
1652
- $sap->add_section(
1653
- 'ewd-ufaq-settings',
1654
- array_merge(
1655
- array(
1656
- 'id' => 'ewd-ufaq-styling-faq-elements',
1657
- 'title' => __( 'FAQ Elements', 'ultimate-faqs' ),
1658
- 'tab' => 'ewd-ufaq-styling-tab',
1659
- ),
1660
- $ewd_ufaq_styling_permissions
1661
- )
1662
- );
1663
-
1664
- $sap->add_setting(
1665
- 'ewd-ufaq-settings',
1666
- 'ewd-ufaq-styling-faq-elements',
1667
- 'colorpicker',
1668
- array(
1669
- 'id' => 'styling-question-font-color',
1670
- 'title' => __( 'Question Font Color', 'ultimate-faqs' )
1671
- )
1672
- );
1673
-
1674
-
1675
- $sap->add_setting(
1676
- 'ewd-ufaq-settings',
1677
- 'ewd-ufaq-styling-faq-elements',
1678
- 'text',
1679
- array(
1680
- 'id' => 'styling-question-font',
1681
- 'title' => __( 'Question Font Family', 'ultimate-faqs' ),
1682
- 'description' => '',
1683
- 'small' => true
1684
- )
1685
- );
1686
-
1687
- $sap->add_setting(
1688
- 'ewd-ufaq-settings',
1689
- 'ewd-ufaq-styling-faq-elements',
1690
- 'text',
1691
- array(
1692
- 'id' => 'styling-question-font-size',
1693
- 'title' => __( 'Question Font Size', 'ultimate-faqs' ),
1694
- 'description' => '',
1695
- 'small' => true
1696
- )
1697
- );
1698
-
1699
- $sap->add_setting(
1700
- 'ewd-ufaq-settings',
1701
- 'ewd-ufaq-styling-faq-elements',
1702
- 'text',
1703
- array(
1704
- 'id' => 'styling-question-margin',
1705
- 'title' => __( 'Question Margin', 'ultimate-faqs' ),
1706
- 'description' => '',
1707
- 'small' => true
1708
- )
1709
- );
1710
-
1711
- $sap->add_setting(
1712
- 'ewd-ufaq-settings',
1713
- 'ewd-ufaq-styling-faq-elements',
1714
- 'text',
1715
- array(
1716
- 'id' => 'styling-question-padding',
1717
- 'title' => __( 'Question Padding', 'ultimate-faqs' ),
1718
- 'description' => '',
1719
- 'small' => true
1720
- )
1721
- );
1722
-
1723
- $sap->add_setting(
1724
- 'ewd-ufaq-settings',
1725
- 'ewd-ufaq-styling-faq-elements',
1726
- 'text',
1727
- array(
1728
- 'id' => 'styling-question-icon-top-margin',
1729
- 'title' => __( 'Toggle Symbol Top Margin', 'ultimate-faqs' ),
1730
- 'description' => '',
1731
- 'small' => true
1732
- )
1733
- );
1734
-
1735
- $sap->add_setting(
1736
- 'ewd-ufaq-settings',
1737
- 'ewd-ufaq-styling-faq-elements',
1738
- 'colorpicker',
1739
- array(
1740
- 'id' => 'styling-answer-font-color',
1741
- 'title' => __( 'Answer Font Color', 'ultimate-faqs' )
1742
- )
1743
- );
1744
-
1745
-
1746
- $sap->add_setting(
1747
- 'ewd-ufaq-settings',
1748
- 'ewd-ufaq-styling-faq-elements',
1749
- 'text',
1750
- array(
1751
- 'id' => 'styling-answer-font',
1752
- 'title' => __( 'Answer Font Family', 'ultimate-faqs' ),
1753
- 'description' => '',
1754
- 'small' => true
1755
- )
1756
- );
1757
-
1758
- $sap->add_setting(
1759
- 'ewd-ufaq-settings',
1760
- 'ewd-ufaq-styling-faq-elements',
1761
- 'text',
1762
- array(
1763
- 'id' => 'styling-answer-font-size',
1764
- 'title' => __( 'Answer Font Size', 'ultimate-faqs' ),
1765
- 'description' => '',
1766
- 'small' => true
1767
- )
1768
- );
1769
-
1770
- $sap->add_setting(
1771
- 'ewd-ufaq-settings',
1772
- 'ewd-ufaq-styling-faq-elements',
1773
- 'text',
1774
- array(
1775
- 'id' => 'styling-answer-margin',
1776
- 'title' => __( 'Answer Margin', 'ultimate-faqs' ),
1777
- 'description' => '',
1778
- 'small' => true
1779
- )
1780
- );
1781
-
1782
- $sap->add_setting(
1783
- 'ewd-ufaq-settings',
1784
- 'ewd-ufaq-styling-faq-elements',
1785
- 'text',
1786
- array(
1787
- 'id' => 'styling-answer-padding',
1788
- 'title' => __( 'Answer Padding', 'ultimate-faqs' ),
1789
- 'description' => '',
1790
- 'small' => true
1791
- )
1792
- );
1793
-
1794
- $sap->add_setting(
1795
- 'ewd-ufaq-settings',
1796
- 'ewd-ufaq-styling-faq-elements',
1797
- 'colorpicker',
1798
- array(
1799
- 'id' => 'styling-category-font-color',
1800
- 'title' => __( 'Categories, Tags Font Color', 'ultimate-faqs' )
1801
- )
1802
- );
1803
-
1804
-
1805
- $sap->add_setting(
1806
- 'ewd-ufaq-settings',
1807
- 'ewd-ufaq-styling-faq-elements',
1808
- 'text',
1809
- array(
1810
- 'id' => 'styling-category-font',
1811
- 'title' => __( 'Categories, Tags Font Family', 'ultimate-faqs' ),
1812
- 'description' => '',
1813
- 'small' => true
1814
- )
1815
- );
1816
-
1817
- $sap->add_setting(
1818
- 'ewd-ufaq-settings',
1819
- 'ewd-ufaq-styling-faq-elements',
1820
- 'text',
1821
- array(
1822
- 'id' => 'styling-category-font-size',
1823
- 'title' => __( 'Categories, Tags Font Size', 'ultimate-faqs' ),
1824
- 'description' => '',
1825
- 'small' => true
1826
- )
1827
- );
1828
-
1829
- $sap->add_setting(
1830
- 'ewd-ufaq-settings',
1831
- 'ewd-ufaq-styling-faq-elements',
1832
- 'text',
1833
- array(
1834
- 'id' => 'styling-category-margin',
1835
- 'title' => __( 'Categories, Tags Margin', 'ultimate-faqs' ),
1836
- 'description' => '',
1837
- 'small' => true
1838
- )
1839
- );
1840
-
1841
- $sap->add_setting(
1842
- 'ewd-ufaq-settings',
1843
- 'ewd-ufaq-styling-faq-elements',
1844
- 'text',
1845
- array(
1846
- 'id' => 'styling-category-padding',
1847
- 'title' => __( 'Categories, Tags Padding', 'ultimate-faqs' ),
1848
- 'description' => '',
1849
- 'small' => true
1850
- )
1851
- );
1852
-
1853
- $sap->add_setting(
1854
- 'ewd-ufaq-settings',
1855
- 'ewd-ufaq-styling-faq-elements',
1856
- 'colorpicker',
1857
- array(
1858
- 'id' => 'styling-postdate-font-color',
1859
- 'title' => __( 'Post Date Font Color', 'ultimate-faqs' )
1860
- )
1861
- );
1862
-
1863
-
1864
- $sap->add_setting(
1865
- 'ewd-ufaq-settings',
1866
- 'ewd-ufaq-styling-faq-elements',
1867
- 'text',
1868
- array(
1869
- 'id' => 'styling-postdate-font',
1870
- 'title' => __( 'Post Date Font Family', 'ultimate-faqs' ),
1871
- 'description' => '',
1872
- 'small' => true
1873
- )
1874
- );
1875
-
1876
- $sap->add_setting(
1877
- 'ewd-ufaq-settings',
1878
- 'ewd-ufaq-styling-faq-elements',
1879
- 'text',
1880
- array(
1881
- 'id' => 'styling-postdate-font-size',
1882
- 'title' => __( 'Post Date Font Size', 'ultimate-faqs' ),
1883
- 'description' => '',
1884
- 'small' => true
1885
- )
1886
- );
1887
-
1888
- $sap->add_setting(
1889
- 'ewd-ufaq-settings',
1890
- 'ewd-ufaq-styling-faq-elements',
1891
- 'text',
1892
- array(
1893
- 'id' => 'styling-postdate-margin',
1894
- 'title' => __( 'Post Date Margin', 'ultimate-faqs' ),
1895
- 'description' => '',
1896
- 'small' => true
1897
- )
1898
- );
1899
-
1900
- $sap->add_setting(
1901
- 'ewd-ufaq-settings',
1902
- 'ewd-ufaq-styling-faq-elements',
1903
- 'text',
1904
- array(
1905
- 'id' => 'styling-postdate-padding',
1906
- 'title' => __( 'Post Date Padding', 'ultimate-faqs' ),
1907
- 'description' => '',
1908
- 'small' => true
1909
- )
1910
- );
1911
-
1912
- $sap->add_section(
1913
- 'ewd-ufaq-settings',
1914
- array_merge(
1915
- array(
1916
- 'id' => 'ewd-ufaq-styling-headings',
1917
- 'title' => __( 'Headings', 'ultimate-faqs' ),
1918
- 'tab' => 'ewd-ufaq-styling-tab',
1919
- ),
1920
- $ewd_ufaq_styling_permissions
1921
- )
1922
- );
1923
-
1924
- $sap->add_setting(
1925
- 'ewd-ufaq-settings',
1926
- 'ewd-ufaq-styling-headings',
1927
- 'radio',
1928
- array(
1929
- 'id' => 'styling-category-heading-type',
1930
- 'title' => __( 'Category Heading Type', 'ultimate-faqs' ),
1931
- 'options' => array(
1932
- 'h1' => __( 'H1', 'ultimate-faqs' ),
1933
- 'h2' => __( 'H2', 'ultimate-faqs' ),
1934
- 'h3' => __( 'H3', 'ultimate-faqs' ),
1935
- 'h4' => __( 'H4', 'ultimate-faqs' ),
1936
- 'h5' => __( 'H5', 'ultimate-faqs' ),
1937
- 'h6' => __( 'H6', 'ultimate-faqs' ),
1938
- ),
1939
- 'default' => $this->defaults['styling-category-heading-type']
1940
- )
1941
- );
1942
-
1943
- $sap->add_setting(
1944
- 'ewd-ufaq-settings',
1945
- 'ewd-ufaq-styling-headings',
1946
- 'radio',
1947
- array(
1948
- 'id' => 'styling-faq-heading-type',
1949
- 'title' => __( 'FAQ Heading Type', 'ultimate-faqs' ),
1950
- 'options' => array(
1951
- 'h1' => __( 'H1', 'ultimate-faqs' ),
1952
- 'h2' => __( 'H2', 'ultimate-faqs' ),
1953
- 'h3' => __( 'H3', 'ultimate-faqs' ),
1954
- 'h4' => __( 'H4', 'ultimate-faqs' ),
1955
- 'h5' => __( 'H5', 'ultimate-faqs' ),
1956
- 'h6' => __( 'H6', 'ultimate-faqs' ),
1957
- ),
1958
- 'default' => $this->defaults['styling-faq-heading-type']
1959
- )
1960
- );
1961
-
1962
- $sap->add_setting(
1963
- 'ewd-ufaq-settings',
1964
- 'ewd-ufaq-styling-headings',
1965
- 'colorpicker',
1966
- array(
1967
- 'id' => 'styling-category-heading-font-color',
1968
- 'title' => __( 'Category Heading Font Color', 'ultimate-faqs' )
1969
- )
1970
- );
1971
-
1972
-
1973
- $sap->add_setting(
1974
- 'ewd-ufaq-settings',
1975
- 'ewd-ufaq-styling-headings',
1976
- 'text',
1977
- array(
1978
- 'id' => 'styling-category-heading-font',
1979
- 'title' => __( 'Category Heading Font Family', 'ultimate-faqs' ),
1980
- 'description' => '',
1981
- 'small' => true
1982
- )
1983
- );
1984
-
1985
- $sap->add_setting(
1986
- 'ewd-ufaq-settings',
1987
- 'ewd-ufaq-styling-headings',
1988
- 'text',
1989
- array(
1990
- 'id' => 'styling-category-heading-font-size',
1991
- 'title' => __( 'Category Heading Font Size', 'ultimate-faqs' ),
1992
- 'description' => '',
1993
- 'small' => true
1994
- )
1995
- );
1996
-
1997
- $sap = apply_filters( 'ewd_ufaq_settings_page', $sap );
1998
-
1999
- $sap->add_admin_menus();
2000
 
 
 
 
2001
  }
2002
  }
2003
  } // endif;
35
 
36
  $this->defaults = array(
37
 
38
+ 'include-permalink' => 'none',
39
+ 'permalink-type' => 'same_page',
40
+ 'access-role' => 'manage_options',
41
+ 'category-order' => 'asc',
42
+ 'faq-order-by' => 'title',
43
+ 'faq-order' => 'asc'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  );
45
 
46
+ $this->defaults = apply_filters( 'ewd_ufaq_defaults', $this->defaults, $this );
47
  }
48
 
49
  /**
93
  public function load_settings_panel() {
94
 
95
  global $ewd_ufaq_controller;
96
+
97
  require_once( EWD_UFAQ_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php' );
98
  $sap = sap_initialize_library(
99
  $args = array(
100
+ 'version' => '2.6.2',
101
  'lib_url' => EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/',
102
  'theme' => 'purple',
103
  )
385
  )
386
  );
387
 
 
 
 
 
 
 
 
 
 
388
  $sap->add_section(
389
  'ewd-ufaq-settings',
390
  array(
391
+ 'id' => 'ewd-ufaq-ordering-tab',
392
+ 'title' => __( 'Ordering', 'ultimate-faqs' ),
393
  'is_tab' => true,
394
  )
395
  );
396
 
397
  $sap->add_section(
398
  'ewd-ufaq-settings',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  array(
400
+ 'id' => 'ewd-ufaq-ordering-settings',
401
+ 'title' => __( 'Settings', 'ultimate-faqs' ),
402
+ 'tab' => 'ewd-ufaq-ordering-tab',
 
 
 
 
 
 
 
 
 
403
  )
404
  );
405
 
406
  $sap->add_setting(
407
  'ewd-ufaq-settings',
408
+ 'ewd-ufaq-ordering-settings',
409
+ 'toggle',
410
  array(
411
+ 'id' => 'group-by-category',
412
+ 'title' => __( 'Group FAQs by Category', 'ultimate-faqs' ),
413
+ 'description' => __( 'Should FAQs be grouped by category, or should all categories be mixed together?', 'ultimate-faqs' )
 
 
 
 
 
 
 
414
  )
415
  );
416
 
417
  $sap->add_setting(
418
  'ewd-ufaq-settings',
419
+ 'ewd-ufaq-ordering-settings',
420
  'toggle',
421
  array(
422
+ 'id' => 'group-by-category-count',
423
+ 'title' => __( 'Display FAQ Category Count', 'ultimate-faqs' ),
424
+ 'description' => __( 'If FAQs are grouped by category, should the number of FAQs in a category be displayed beside the category name?', 'ultimate-faqs' ),
425
+ 'conditional_on' => 'group-by-category',
426
+ 'conditional_on_value' => true
427
  )
428
+ );
429
 
430
  $sap->add_setting(
431
  'ewd-ufaq-settings',
432
+ 'ewd-ufaq-ordering-settings',
433
  'select',
434
  array(
435
+ 'id' => 'category-order-by',
436
+ 'title' => __( 'Sort Categories', 'ultimate-faqs' ),
437
+ 'description' => __( 'How should FAQ categories be ordered? (Only used if "Group FAQs by Category" above is enabled.)', 'ultimate-faqs' ),
438
  'blank_option' => false,
439
  'options' => array(
440
+ 'name' => __( 'Name', 'ultimate-faqs' ),
441
+ 'count' => __( 'FAQ Count', 'ultimate-faqs' ),
442
+ 'slug' => __( 'Slug', 'ultimate-faqs' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
  ),
444
+ 'conditional_on' => 'group-by-category',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  'conditional_on_value' => true
446
  )
447
  );
448
 
449
  $sap->add_setting(
450
  'ewd-ufaq-settings',
451
+ 'ewd-ufaq-ordering-settings',
452
+ 'radio',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  array(
454
+ 'id' => 'category-order',
455
+ 'title' => __( 'Sort Categories Ordering', 'ultimate-faqs' ),
456
+ 'description' => __( 'How should FAQ categories be ordered? (Only used if "Group FAQs by Category" above is enabled.)', 'ultimate-faqs' ),
457
  'options' => array(
458
+ 'asc' => __( 'Ascending', 'ultimate-faqs' ),
459
+ 'desc' => __( 'Descending', 'ultimate-faqs' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460
  ),
461
+ 'default' => $this->defaults['category-order'],
462
+ 'conditional_on' => 'group-by-category',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
463
  'conditional_on_value' => true
464
  )
465
  );
466
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  $sap->add_setting(
468
  'ewd-ufaq-settings',
469
+ 'ewd-ufaq-ordering-settings',
470
+ 'radio',
471
  array(
472
+ 'id' => 'faq-order-by',
473
+ 'title' => __( 'FAQ Ordering', 'ultimate-faqs' ),
474
+ 'description' => __( 'How should individual FAQs be ordered?', 'ultimate-faqs' ),
475
+ 'blank_option' => false,
476
+ 'options' => array(
477
+ 'date' => __( 'Created Date', 'ultimate-faqs' ),
478
+ 'title' => __( 'Title', 'ultimate-faqs' ),
479
+ 'modified' => __( 'Modified Date', 'ultimate-faqs' ),
480
+ 'set_order' => __( 'Selected Order (Premium option)', 'ultimate-faqs' ),
481
+ ),
482
+ 'default' => $this->defaults['faq-order-by']
483
  )
484
  );
485
 
486
  $sap->add_setting(
487
  'ewd-ufaq-settings',
488
+ 'ewd-ufaq-ordering-settings',
489
  'radio',
490
  array(
491
+ 'id' => 'faq-order',
492
+ 'title' => __( 'Sort FAQs Ordering', 'ultimate-faqs' ),
493
+ 'description' => __( 'Should FAQ be ascending or descending order, based on the ordering criteria above?', 'ultimate-faqs' ),
494
  'options' => array(
495
+ 'asc' => __( 'Ascending', 'ultimate-faqs' ),
496
+ 'desc' => __( 'Descending', 'ultimate-faqs' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
497
  ),
498
+ 'default' => $this->defaults['faq-order']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  )
500
  );
501
 
502
+ /**
503
+ * Premium options preview only
504
+ */
505
+ // "Premium" Tab
506
+ $sap->add_section(
507
+ 'ewd-ufaq-settings',
508
+ array(
509
+ 'id' => 'ewd-ufaq-premium-tab',
510
+ 'title' => __( 'Premium', 'ultimate-faqs' ),
511
+ 'is_tab' => true,
512
+ 'show_submit_button' => $this->show_submit_button( 'premium' )
513
+ )
514
+ );
515
+ $sap->add_section(
516
+ 'ewd-ufaq-settings',
517
+ array(
518
+ 'id' => 'ewd-ufaq-premium-tab-body',
519
+ 'tab' => 'ewd-ufaq-premium-tab',
520
+ 'callback' => $this->premium_info( 'premium' )
521
+ )
522
+ );
523
+
524
+ // "Fields" Tab
525
+ $sap->add_section(
526
+ 'ewd-ufaq-settings',
527
+ array(
528
+ 'id' => 'ewd-ufaq-fields-tab',
529
+ 'title' => __( 'Fields', 'ultimate-faqs' ),
530
+ 'is_tab' => true,
531
+ 'show_submit_button' => $this->show_submit_button( 'fields' )
532
+ )
533
+ );
534
+ $sap->add_section(
535
+ 'ewd-ufaq-settings',
536
+ array(
537
+ 'id' => 'ewd-ufaq-fields-tab-body',
538
+ 'tab' => 'ewd-ufaq-fields-tab',
539
+ 'callback' => $this->premium_info( 'fields' )
540
+ )
541
+ );
542
+
543
+ // "Labelling" Tab
544
+ $sap->add_section(
545
+ 'ewd-ufaq-settings',
546
+ array(
547
+ 'id' => 'ewd-ufaq-labelling-tab',
548
+ 'title' => __( 'Labelling', 'ultimate-faqs' ),
549
+ 'is_tab' => true,
550
+ 'show_submit_button' => $this->show_submit_button( 'labelling' )
551
+ )
552
+ );
553
+ $sap->add_section(
554
+ 'ewd-ufaq-settings',
555
+ array(
556
+ 'id' => 'ewd-ufaq-labelling-tab-body',
557
+ 'tab' => 'ewd-ufaq-labelling-tab',
558
+ 'callback' => $this->premium_info( 'labelling' )
559
+ )
560
+ );
561
+
562
+ // "Styling" Tab
563
+ $sap->add_section(
564
+ 'ewd-ufaq-settings',
565
+ array(
566
+ 'id' => 'ewd-ufaq-styling-tab',
567
+ 'title' => __( 'Styling', 'ultimate-faqs' ),
568
+ 'is_tab' => true,
569
+ 'show_submit_button' => $this->show_submit_button( 'styling' )
570
+ )
571
+ );
572
+ $sap->add_section(
573
+ 'ewd-ufaq-settings',
574
+ array(
575
+ 'id' => 'ewd-ufaq-styling-tab-body',
576
+ 'tab' => 'ewd-ufaq-styling-tab',
577
+ 'callback' => $this->premium_info( 'styling' )
578
+ )
579
+ );
580
+
581
+ $sap = apply_filters( 'ewd_ufaq_settings_page', $sap, $this );
582
 
583
+ $sap->add_admin_menus();
584
 
585
+ }
586
 
587
+ public function show_submit_button( $permission_type = '' ) {
588
+ global $ewd_ufaq_controller;
589
 
590
+ if ( $ewd_ufaq_controller->permissions->check_permission( $permission_type ) ) {
591
+ return true;
592
  }
593
 
594
+ return false;
595
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
596
 
597
+ public function premium_info( $section_and_perm_type )
598
+ {
599
+ global $ewd_ufaq_controller;
 
 
 
 
 
 
 
 
 
 
600
 
601
+ $is_premium_user = $ewd_ufaq_controller->permissions->check_permission( $section_and_perm_type );
602
+ $is_helper_installed = defined('EWDPH_PLUGIN_FNAME') && is_plugin_active( EWDPH_PLUGIN_FNAME );
603
 
604
+ if ( $is_premium_user || $is_helper_installed ) {
605
+ return false;
606
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
 
608
+ $content = '';
609
+
610
+ $premium_features = '
611
+ <p><strong>' . __( 'The premium version also gives you access to the following features:', 'ultimate-faqs' ) . '</strong></p>
612
+ <ul class="ewd-ufaq-dashboard-new-footer-one-benefits">
613
+ <li>' . __( 'Unlimited FAQs', 'ultimate-faqs' ) . '</li>
614
+ <li>' . __( 'FAQ Search', 'ultimate-faqs' ) . '</li>
615
+ <li>' . __( 'Custom Fields', 'ultimate-faqs' ) . '</li>
616
+ <li>' . __( 'WooCommerce FAQs', 'ultimate-faqs' ) . '</li>
617
+ <li>' . __( '15 Different Icon Sets', 'ultimate-faqs' ) . '</li>
618
+ <li>' . __( 'Import/Export FAQs', 'ultimate-faqs' ) . '</li>
619
+ <li>' . __( 'Advanced Styling Options', 'ultimate-faqs' ) . '</li>
620
+ <li>' . __( 'Social Sharing', 'ultimate-faqs' ) . '</li>
621
+ <li>' . __( 'Email Support', 'ultimate-faqs' ) . '</li>
622
+ </ul>
623
+ <div class="ewd-ufaq-dashboard-new-footer-one-buttons">
624
+ <a class="ewd-ufaq-dashboard-new-upgrade-button" href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">' . __( 'UPGRADE NOW', 'ultimate-faqs' ) . '</a>
625
+ </div>
626
+ ';
627
+
628
+ switch ( $section_and_perm_type ) {
629
+ case 'premium':
630
+ $content = '
631
+ <div class="ewd-ufaq-settings-preview">
632
+ <h2>' . __( 'Premium', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
633
+ <p>' . __( 'The premium options let you change the FAQ layout, configure WooCommerce and WPForms integration, add reveal effects, paginate your FAQs, add an FAQ rating/voting system, add social sharing, change the the slug base of the post type and much more.', 'ultimate-faqs' ) . '</p>
634
+ <div class="ewd-ufaq-settings-preview-images">
635
+ <img src="' . EWD_UFAQ_PLUGIN_URL . '/assets/img/premium-screenshots/premium1.png" alt="UFAQ premium screenshot one">
636
+ <img src="' . EWD_UFAQ_PLUGIN_URL . '/assets/img/premium-screenshots/premium2.png" alt="UFAQ premium screenshot two">
637
+ </div>
638
+ ' . $premium_features . '
639
+ </div>
640
+ ';
641
+ break;
642
+ case 'fields':
643
+ $content = '
644
+ <div class="ewd-ufaq-settings-preview">
645
+ <h2>' . __( 'Fields', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
646
+ <p>' . __( 'You can add custom fields to your FAQs, which let you display extra content, such as product manuals, location info, links and more. ', 'ultimate-faqs' ) . '</p>
647
+ <div class="ewd-ufaq-settings-preview-images">
648
+ <img src="' . EWD_UFAQ_PLUGIN_URL . '/assets/img/premium-screenshots/fields.png" alt="UFAQ fields screenshot">
649
+ </div>
650
+ ' . $premium_features . '
651
+ </div>
652
+ ';
653
+ break;
654
+ case 'labelling':
655
+ $content = '
656
+ <div class="ewd-ufaq-settings-preview">
657
+ <h2>' . __( 'Labelling', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
658
+ <p>' . __( 'The labelling options let you change the wording of the different labels that appear on the front end of the plugin. You can use this to translate them, customize the wording for your purpose, etc.', 'ultimate-faqs' ) . '</p>
659
+ <div class="ewd-ufaq-settings-preview-images">
660
+ <img src="' . EWD_UFAQ_PLUGIN_URL . '/assets/img/premium-screenshots/labelling1.png" alt="UFAQ labelling screenshot one">
661
+ <img src="' . EWD_UFAQ_PLUGIN_URL . '/assets/img/premium-screenshots/labelling2.png" alt="UFAQ labelling screenshot two">
662
+ </div>
663
+ ' . $premium_features . '
664
+ </div>
665
+ ';
666
+ break;
667
+ case 'styling':
668
+ $content = '
669
+ <div class="ewd-ufaq-settings-preview">
670
+ <h2>' . __( 'Styling', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
671
+ <p>' . __( 'The styling options let you change the toggle symbol and FAQ heading types, as well as modify the color, font size, font family, border, margin and padding of the various elements found in your FAQs.', 'ultimate-faqs' ) . '</p>
672
+ <div class="ewd-ufaq-settings-preview-images">
673
+ <img src="' . EWD_UFAQ_PLUGIN_URL . '/assets/img/premium-screenshots/styling1.png" alt="UFAQ styling screenshot one">
674
+ <img src="' . EWD_UFAQ_PLUGIN_URL . '/assets/img/premium-screenshots/styling2.png" alt="UFAQ styling screenshot two">
675
+ </div>
676
+ ' . $premium_features . '
677
+ </div>
678
+ ';
679
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
681
 
682
+ return function() use( $content ) {
683
+ echo $content;
684
+ };
685
  }
686
  }
687
  } // endif;
lib/simple-admin-pages/classes/AdminPage.Menu.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageMenu_2_6_1 extends sapAdminPage_2_6_1 {
12
 
13
  public $setup_function = 'add_menu_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageMenu_2_6_2 extends sapAdminPage_2_6_2 {
12
 
13
  public $setup_function = 'add_menu_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.Submenu.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageSubmenu_2_6_1 extends sapAdminPage_2_6_1 {
12
 
13
  public $setup_function = 'add_submenu_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageSubmenu_2_6_2 extends sapAdminPage_2_6_2 {
12
 
13
  public $setup_function = 'add_submenu_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.Themes.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageThemes_2_6_1 extends sapAdminPage_2_6_1 {
12
 
13
  public $setup_function = 'add_theme_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageThemes_2_6_2 extends sapAdminPage_2_6_2 {
12
 
13
  public $setup_function = 'add_theme_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPage_2_6_1 {
11
 
12
  public $title;
13
  public $menu_title;
@@ -198,6 +198,10 @@ class sapAdminPage_2_6_1 {
198
  )
199
  );
200
 
 
 
 
 
201
  $active = $current_page == $section->id ? ' nav-tab-active' : '';
202
  echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $section->title ) . '" class="nav-tab' . $active . '">';
203
  echo esc_html( $section->title );
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPage_2_6_2 {
11
 
12
  public $title;
13
  public $menu_title;
198
  )
199
  );
200
 
201
+ if( isset( $section->show_submit_button ) && $current_page == $section->id ) {
202
+ $this->show_button = $section->show_submit_button;
203
+ }
204
+
205
  $active = $current_page == $section->id ? ' nav-tab-active' : '';
206
  echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $section->title ) . '" class="nav-tab' . $active . '">';
207
  echo esc_html( $section->title );
lib/simple-admin-pages/classes/AdminPageSection.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSection_2_6_1 {
11
 
12
  // Page defaults
13
  public $id; // unique id for this section
@@ -150,7 +150,13 @@ class sapAdminPageSection_2_6_1 {
150
  * @since 1.0
151
  */
152
  public function add_settings_section() {
153
- add_settings_section( $this->id, $this->title, array( $this, 'display_section' ), $this->get_page_slug() );
 
 
 
 
 
 
154
  }
155
 
156
  /**
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSection_2_6_2 {
11
 
12
  // Page defaults
13
  public $id; // unique id for this section
150
  * @since 1.0
151
  */
152
  public function add_settings_section() {
153
+
154
+ // Callback can be overridden from outside the class.
155
+ $callback = property_exists( $this, 'callback' ) && is_callable( $this->callback )
156
+ ? $this->callback
157
+ : array( $this, 'display_section' );
158
+
159
+ add_settings_section( $this->id, $this->title, $callback, $this->get_page_slug() );
160
  }
161
 
162
  /**
lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingAddress_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  /*
13
  * Size of this textarea
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingAddress_2_6_2 extends sapAdminPageSetting_2_6_2 {
11
 
12
  /*
13
  * Size of this textarea
lib/simple-admin-pages/classes/AdminPageSetting.Checkbox.class.php CHANGED
@@ -19,7 +19,7 @@
19
  * @package Simple Admin Pages
20
  */
21
 
22
- class sapAdminPageSettingCheckbox_2_6_1 extends sapAdminPageSetting_2_6_1 {
23
 
24
  //public $sanitize_callback = 'sanitize_text_field';
25
 
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingCheckbox_2_6_2 extends sapAdminPageSetting_2_6_2 {
23
 
24
  //public $sanitize_callback = 'sanitize_text_field';
25
 
lib/simple-admin-pages/classes/AdminPageSetting.ColorPicker.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingColorPicker_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingColorPicker_2_6_2 extends sapAdminPageSetting_2_6_2 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.Count.class.php CHANGED
@@ -24,7 +24,7 @@
24
  * @package Simple Admin Pages
25
  */
26
 
27
- class sapAdminPageSettingCount_2_6_1 extends sapAdminPageSetting_2_6_1 {
28
 
29
  public $sanitize_callback = 'sanitize_text_field';
30
 
24
  * @package Simple Admin Pages
25
  */
26
 
27
+ class sapAdminPageSettingCount_2_6_2 extends sapAdminPageSetting_2_6_2 {
28
 
29
  public $sanitize_callback = 'sanitize_text_field';
30
 
lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingEditor_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'wp_kses_post';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingEditor_2_6_2 extends sapAdminPageSetting_2_6_2 {
11
 
12
  public $sanitize_callback = 'wp_kses_post';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.FileUpload.class.php CHANGED
@@ -15,7 +15,7 @@
15
  * @package Simple Admin Pages
16
  */
17
 
18
- class sapAdminPageSettingFileUpload_2_6_1 extends sapAdminPageSetting_2_6_1 {
19
 
20
  public $sanitize_callback = 'esc_url_raw';
21
 
15
  * @package Simple Admin Pages
16
  */
17
 
18
+ class sapAdminPageSettingFileUpload_2_6_2 extends sapAdminPageSetting_2_6_2 {
19
 
20
  public $sanitize_callback = 'esc_url_raw';
21
 
lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php CHANGED
@@ -14,7 +14,7 @@
14
  * @package Simple Admin Pages
15
  */
16
 
17
- class sapAdminPageSettingHTML_2_6_1 extends sapAdminPageSetting_2_6_1 {
18
 
19
  public $sanitize_callback = 'sanitize_text_field';
20
 
14
  * @package Simple Admin Pages
15
  */
16
 
17
+ class sapAdminPageSettingHTML_2_6_2 extends sapAdminPageSetting_2_6_2 {
18
 
19
  public $sanitize_callback = 'sanitize_text_field';
20
 
lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingImage_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'absint';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingImage_2_6_2 extends sapAdminPageSetting_2_6_2 {
11
 
12
  public $sanitize_callback = 'absint';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php CHANGED
@@ -24,7 +24,7 @@
24
  * @package Simple Admin Pages
25
  */
26
 
27
- class sapAdminPageSettingInfiniteTable_2_6_1 extends sapAdminPageSetting_2_6_1 {
28
 
29
  public $sanitize_callback = 'sanitize_textarea_field';
30
 
24
  * @package Simple Admin Pages
25
  */
26
 
27
+ class sapAdminPageSettingInfiniteTable_2_6_2 extends sapAdminPageSetting_2_6_2 {
28
 
29
  public $sanitize_callback = 'sanitize_textarea_field';
30
 
lib/simple-admin-pages/classes/AdminPageSetting.McApiKey.class.php CHANGED
@@ -14,7 +14,7 @@
14
  *
15
  */
16
 
17
- class mcfrtbAdminPageSettingMcApiKey_2_6_1 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
14
  *
15
  */
16
 
17
+ class mcfrtbAdminPageSettingMcApiKey_2_6_2 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
lib/simple-admin-pages/classes/AdminPageSetting.McListMerge.class.php CHANGED
@@ -14,7 +14,7 @@
14
  *
15
  */
16
 
17
- class mcfrtbAdminPageSettingMcListMerge_2_6_1 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
14
  *
15
  */
16
 
17
+ class mcfrtbAdminPageSettingMcListMerge_2_6_2 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
lib/simple-admin-pages/classes/AdminPageSetting.Number.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingNumber_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingNumber_2_6_2 extends sapAdminPageSetting_2_6_2 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php CHANGED
@@ -25,7 +25,7 @@
25
  * @package Simple Admin Pages
26
  */
27
 
28
- class sapAdminPageSettingOpeningHours_2_6_1 extends sapAdminPageSetting_2_6_1 {
29
 
30
  public $sanitize_callback = 'sanitize_text_field';
31
 
25
  * @package Simple Admin Pages
26
  */
27
 
28
+ class sapAdminPageSettingOpeningHours_2_6_2 extends sapAdminPageSetting_2_6_2 {
29
 
30
  public $sanitize_callback = 'sanitize_text_field';
31
 
lib/simple-admin-pages/classes/AdminPageSetting.Ordering.class.php CHANGED
@@ -18,7 +18,7 @@
18
  * @package Simple Admin Pages
19
  */
20
 
21
- class sapAdminPageSettingOrdering_2_6_1 extends sapAdminPageSetting_2_6_1 {
22
 
23
  public $sanitize_callback = 'sanitize_text_field';
24
 
18
  * @package Simple Admin Pages
19
  */
20
 
21
+ class sapAdminPageSettingOrdering_2_6_2 extends sapAdminPageSetting_2_6_2 {
22
 
23
  public $sanitize_callback = 'sanitize_text_field';
24
 
lib/simple-admin-pages/classes/AdminPageSetting.Radio.class.php CHANGED
@@ -19,7 +19,7 @@
19
  * @package Simple Admin Pages
20
  */
21
 
22
- class sapAdminPageSettingRadio_2_6_1 extends sapAdminPageSetting_2_6_1 {
23
 
24
  public $sanitize_callback = 'sanitize_text_field';
25
 
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingRadio_2_6_2 extends sapAdminPageSetting_2_6_2 {
23
 
24
  public $sanitize_callback = 'sanitize_text_field';
25
 
lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php CHANGED
@@ -10,7 +10,7 @@
10
  * @package Simple Admin Pages
11
  */
12
 
13
- class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
14
 
15
  public $sanitize_callback = 'sanitize_text_field';
16
 
10
  * @package Simple Admin Pages
11
  */
12
 
13
+ class sapAdminPageSettingScheduler_2_6_2 extends sapAdminPageSetting_2_6_2 {
14
 
15
  public $sanitize_callback = 'sanitize_text_field';
16
 
lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php CHANGED
@@ -21,7 +21,7 @@
21
  * @package Simple Admin Pages
22
  */
23
 
24
- class sapAdminPageSettingSelect_2_6_1 extends sapAdminPageSetting_2_6_1 {
25
 
26
  public $sanitize_callback = 'sanitize_text_field';
27
 
21
  * @package Simple Admin Pages
22
  */
23
 
24
+ class sapAdminPageSettingSelect_2_6_2 extends sapAdminPageSetting_2_6_2 {
25
 
26
  public $sanitize_callback = 'sanitize_text_field';
27
 
lib/simple-admin-pages/classes/AdminPageSetting.SelectMenu.class.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Simple Admin Pages
18
  */
19
 
20
- class sapAdminPageSettingSelectMenu_2_6_1 extends sapAdminPageSetting_2_6_1 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingSelectMenu_2_6_2 extends sapAdminPageSetting_2_6_2 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Simple Admin Pages
18
  */
19
 
20
- class sapAdminPageSettingSelectPost_2_6_1 extends sapAdminPageSetting_2_6_1 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingSelectPost_2_6_2 extends sapAdminPageSetting_2_6_2 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php CHANGED
@@ -19,7 +19,7 @@
19
  * @package Simple Admin Pages
20
  */
21
 
22
- class sapAdminPageSettingSelectTaxonomy_2_6_1 extends sapAdminPageSetting_2_6_1 {
23
 
24
  public $sanitize_callback = 'intval';
25
 
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingSelectTaxonomy_2_6_2 extends sapAdminPageSetting_2_6_2 {
23
 
24
  public $sanitize_callback = 'intval';
25
 
lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingText_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingText_2_6_2 extends sapAdminPageSetting_2_6_2 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php CHANGED
@@ -9,7 +9,7 @@
9
  * @todo textareas should have an option to swap new lines for <br>s
10
  */
11
 
12
- class sapAdminPageSettingTextarea_2_6_1 extends sapAdminPageSetting_2_6_1 {
13
 
14
  /*
15
  * Size of this textarea
9
  * @todo textareas should have an option to swap new lines for <br>s
10
  */
11
 
12
+ class sapAdminPageSettingTextarea_2_6_2 extends sapAdminPageSetting_2_6_2 {
13
 
14
  /*
15
  * Size of this textarea
lib/simple-admin-pages/classes/AdminPageSetting.Time.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingTime_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingTime_2_6_2 extends sapAdminPageSetting_2_6_2 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Simple Admin Pages
18
  */
19
 
20
- class sapAdminPageSettingToggle_2_6_1 extends sapAdminPageSetting_2_6_1 {
21
 
22
  public $sanitize_callback = 'sanitize_text_field';
23
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingToggle_2_6_2 extends sapAdminPageSetting_2_6_2 {
21
 
22
  public $sanitize_callback = 'sanitize_text_field';
23
 
lib/simple-admin-pages/classes/AdminPageSetting.WarningTip.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingWarningTip_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingWarningTip_2_6_2 extends sapAdminPageSetting_2_6_2 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.class.php CHANGED
@@ -16,7 +16,7 @@
16
  * @package Simple Admin Pages
17
  */
18
 
19
- abstract class sapAdminPageSetting_2_6_1 {
20
 
21
  // Page defaults
22
  public $id; // used in form fields and database to track and store setting
16
  * @package Simple Admin Pages
17
  */
18
 
19
+ abstract class sapAdminPageSetting_2_6_2 {
20
 
21
  // Page defaults
22
  public $id; // used in form fields and database to track and store setting
lib/simple-admin-pages/classes/Library.class.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- if ( !class_exists( 'sapLibrary_2_6_1' ) ) {
3
  /**
4
  * This library class loads and provides access to the correct version of the
5
  * Simple Admin Pages library.
@@ -7,10 +7,10 @@ if ( !class_exists( 'sapLibrary_2_6_1' ) ) {
7
  * @since 1.0
8
  * @package Simple Admin Pages
9
  */
10
- class sapLibrary_2_6_1 {
11
 
12
  // Version of the library
13
- private $version = '2.6.1';
14
 
15
  // A full URL to the library which is used to correctly link scripts and
16
  // stylesheets.
@@ -49,7 +49,7 @@ class sapLibrary_2_6_1 {
49
  public function __construct( $args ) {
50
 
51
  if ( ! defined( 'SAP_VERSION' ) ) {
52
- define( 'SAP_VERSION', '2.6.1' );
53
  }
54
 
55
  // If no URL path to the library is passed, we won't be able to add the
1
  <?php
2
+ if ( !class_exists( 'sapLibrary_2_6_2' ) ) {
3
  /**
4
  * This library class loads and provides access to the correct version of the
5
  * Simple Admin Pages library.
7
  * @since 1.0
8
  * @package Simple Admin Pages
9
  */
10
+ class sapLibrary_2_6_2 {
11
 
12
  // Version of the library
13
+ private $version = '2.6.2';
14
 
15
  // A full URL to the library which is used to correctly link scripts and
16
  // stylesheets.
49
  public function __construct( $args ) {
50
 
51
  if ( ! defined( 'SAP_VERSION' ) ) {
52
+ define( 'SAP_VERSION', '2.6.2' );
53
  }
54
 
55
  // If no URL path to the library is passed, we won't be able to add the
lib/simple-admin-pages/js/admin-settings.js CHANGED
@@ -99,6 +99,7 @@ jQuery( document ).ready( function() {
99
  });
100
  }
101
 
102
- setTimeout( resizeLockdownBoxes, 750 );
103
- jQuery( window ).on( 'resize', resizeLockdownBoxes );
 
104
  });
99
  });
100
  }
101
 
102
+ setTimeout( resizeLockdownBoxes, 750 );
103
+ setInterval( resizeLockdownBoxes, 3000 );
104
+ jQuery( window ).on( 'resize', resizeLockdownBoxes );
105
  });
readme.txt CHANGED
@@ -266,6 +266,10 @@ Video 3 - FAQs Ordering
266
 
267
  == Changelog ==
268
 
 
 
 
 
269
  = 2.0.26 (2021-12-13) =
270
  - Added a notice pertaining to the requirement of the premium helper plugin to access premium settings and content.
271
 
266
 
267
  == Changelog ==
268
 
269
+ = 2.1.0 (2021-12-21) =
270
+ - Changed how premium settings areas are previewed.
271
+ - CSS styling update for the FAQ Details area on the FAQ edit screen.
272
+
273
  = 2.0.26 (2021-12-13) =
274
  - Added a notice pertaining to the requirement of the premium helper plugin to access premium settings and content.
275
 
ultimate-faqs.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
  /*
3
  Plugin Name: Ultimate FAQ - WordPress FAQ and Accordion Plugin
4
- Plugin URI: http://www.etoilewebdesign.com/plugins/ultimate-faqs/
5
  Description: FAQ and accordion plugin with easy to use Gutenberg blocks, shortcodes and widgets. Includes an advanced FAQ search and FAQ schema.
6
- Author URI: https://www.etoilewebdesign.com/plugins/ultimate-faqs/
7
  Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
8
  Text Domain: ultimate-faqs
9
- Version: 2.0.26
10
  WC requires at least: 3.0
11
- WC tested up to: 5.6
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) )
@@ -43,7 +43,7 @@ class ewdufaqInit {
43
  define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
44
  define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
45
  define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
46
- define( 'EWD_UFAQ_VERSION', '2.0.26' );
47
 
48
  define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
49
  define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
@@ -64,9 +64,7 @@ class ewdufaqInit {
64
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/CustomPostTypes.class.php' );
65
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Dashboard.class.php' );
66
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/DeactivationSurvey.class.php' );
67
- require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Export.class.php' );
68
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/FAQ.class.php' );
69
- require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Import.class.php' );
70
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/InstallationWalkthrough.class.php' );
71
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Notifications.class.php' );
72
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/OrderingTable.class.php' );
@@ -111,8 +109,6 @@ class ewdufaqInit {
111
 
112
  new ewdufaqAJAX();
113
  new ewdufaqBlocks();
114
- new ewdufaqExport();
115
- new ewdufaqImport();
116
  new ewdufaqNotifications();
117
  new ewdufaqOrderingTable();
118
  new ewdufaqUltimateWPMail();
@@ -131,25 +127,27 @@ class ewdufaqInit {
131
  register_activation_hook( __FILE__, array( $this, 'run_walkthrough' ) );
132
  register_activation_hook( __FILE__, array( $this, 'convert_options' ) );
133
 
134
- add_filter( 'init', array( $this, 'rewrite_rules' ) );
135
- add_filter( 'query_vars', array( $this, 'add_query_vars' ) );
136
- add_filter( 'redirect_canonical', array( $this, 'disable_canonical_redirect_for_front_page' ) );
137
 
138
- add_filter( 'the_content', array( $this, 'alter_faq_content' ) );
139
- add_action( 'wp_footer', array( $this, 'output_ld_json_content' ) );
 
140
 
141
- add_action( 'init', array( $this, 'load_view_files' ) );
 
142
 
143
- add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
144
 
145
- add_action( 'admin_notices', array( $this, 'display_header_area' ) );
146
- add_action( 'admin_notices', array( $this, 'maybe_display_helper_notice' ) );
147
 
148
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ), 10, 1 );
149
- add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ) );
150
- add_action( 'wp_head', 'ewd_add_frontend_ajax_url' );
151
 
152
- add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2);
 
 
 
 
153
 
154
  add_action( 'wp_ajax_ewd_ufaq_hide_helper_notice', array( $this, 'hide_helper_notice' ) );
155
  }
@@ -180,8 +178,8 @@ class ewdufaqInit {
180
  $frontpage_id = get_option( 'page_on_front' );
181
 
182
  add_rewrite_tag( '%single_faq%', '([^&]+)' );
183
- add_rewrite_tag( '%ufaq_category_slug%', '([^+]+)' );
184
- add_rewrite_tag( '%ufaq_tag_slug%', '([^?]+)' );
185
 
186
  add_rewrite_rule( "single-faq/([^&]*)/?$", "index.php?page_id=". $frontpage_id . "&single_faq=\$matches[1]", 'top' );
187
  add_rewrite_rule( "(.?.+?)/single-faq/([^&]*)/?$", "index.php?pagename=\$matches[1]&single_faq=\$matches[2]", 'top' );
@@ -272,17 +270,34 @@ class ewdufaqInit {
272
  * @since 2.0.0
273
  */
274
  public function enqueue_admin_assets( $hook ) {
275
- global $post;
276
 
277
  wp_enqueue_script( 'ewd-ufaq-helper-notice', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-helper-install-notice.js', array( 'jquery' ), EWD_UFAQ_VERSION, true );
278
- wp_enqueue_style( 'ewd-ufaq-helper-notice', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-helper-install-notice.css', array(), EWD_UFAQ_VERSION );
 
 
 
 
279
 
280
- $post_type = is_object( $post ) ? $post->post_type : '';
281
 
282
  $screen = get_current_screen();
283
 
284
- // Return if not ufaq post_type, we're not on a post-type page, or we're not on the settings or widget pages
285
- if ( ( $post_type != EWD_UFAQ_FAQ_POST_TYPE or ( $hook != 'edit.php' and $hook != 'post-new.php' and $hook != 'post.php' ) ) and $hook != 'ufaq_page_ewd-ufaq-settings' and $hook != 'ufaq_page_ewd-ufaq-ordering-table' and $hook != 'widgets.php' and $screen->id != 'edit-ufaq-category' and $screen->id != 'edit-ufaq-tag' ) { return; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
 
287
  wp_enqueue_style( 'ewd-ufaq-admin-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-admin.css', array(), EWD_UFAQ_VERSION );
288
 
@@ -408,22 +423,75 @@ class ewdufaqInit {
408
  </div>
409
  <?php
410
  }
411
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  ?>
413
  <div class="ewd-ufaq-admin-header-menu">
414
  <h2 class="nav-tab-wrapper">
415
- <a id="ewd-ufaq-dash-mobile-menu-open" href="#" class="menu-tab nav-tab"><?php _e("MENU", 'ultimate-faqs'); ?><span id="ewd-ufaq-dash-mobile-menu-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-menu-up-caret">&nbsp;&nbsp;&#9650;</span></a>
416
- <a id="dashboard-menu" href='admin.php?page=ewd-ufaq-dashboard' class="menu-tab nav-tab <?php if ( $screen->id == 'ufaq_ewd-ufaq-dashboard' ) {echo 'nav-tab-active';}?>"><?php _e("Dashboard", 'ultimate-faqs'); ?></a>
417
- <a id="faqs-menu" href='edit.php?post_type=ufaq' class="menu-tab nav-tab <?php if ( $screen->id == 'edit-ufaq' ) {echo 'nav-tab-active';}?>"><?php _e("FAQs", 'ultimate-faqs'); ?></a>
418
- <a id="add-faq-menu" href='post-new.php?post_type=ufaq' class="menu-tab nav-tab"><?php _e("Add New", 'ultimate-faqs'); ?></a>
419
- <a id="categories-menu" href='edit-tags.php?taxonomy=ufaq-category&post_type=ufaq' class="menu-tab nav-tab <?php if ( $screen->id == 'edit-ufaq-category' ) {echo 'nav-tab-active';}?>"><?php _e("Categories", 'ultimate-faqs'); ?></a>
420
- <a id="tags-menu" href='edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq' class="menu-tab nav-tab <?php if ( $screen->id == 'edit-ufaq-tag' ) {echo 'nav-tab-active';}?>"><?php _e("Tags", 'ultimate-faqs'); ?></a>
421
- <a id="import-menu" href='edit.php?post_type=ufaq&page=ewd-ufaq-import' class="menu-tab nav-tab <?php if ( $screen->id == 'ewd_ufaq_page_ewd-ufaq-import' ) {echo 'nav-tab-active';}?>"><?php _e("Import", 'ultimate-faqs'); ?></a>
422
- <a id="export-menu" href='edit.php?post_type=ufaq&page=ewd-ufaq-export' class="menu-tab nav-tab <?php if ( $screen->id == 'ewd_ufaq_page_ewd-ufaq-export' ) {echo 'nav-tab-active';}?>"><?php _e("Export", 'ultimate-faqs'); ?></a>
423
- <?php if ( $ewd_ufaq_controller->settings->get_setting( 'faq-order-by' ) == 'set_order' ) { ?>
424
- <a id="ordering-table" href='edit.php?post_type=ufaq&page=ewd-ufaq-ordering-table' class="menu-tab nav-tab <?php if ( $screen->id == 'ewd_ufaq_page_ewd-ufaq-ordering-table' ) {echo 'nav-tab-active';}?>"><?php _e("FAQ Order", 'ultimate-faqs'); ?></a>
425
- <?php } ?>
426
- <a id="options-menu" href='edit.php?post_type=ufaq&page=ewd-ufaq-settings' class="menu-tab nav-tab <?php if ( $screen->id == 'ewd_ufaq_page_ewd-ufaq-settings' ) {echo 'nav-tab-active';}?>"><?php _e("Settings", 'ultimate-faqs'); ?></a>
 
 
 
 
 
 
 
 
 
 
 
427
  </h2>
428
  </div>
429
  <?php
@@ -461,9 +529,46 @@ class ewdufaqInit {
461
 
462
  public function hide_helper_notice() {
463
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  set_transient( 'ewd-helper-notice-dismissed', true, 3600*24*7 );
465
 
466
- die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  }
468
 
469
  }
@@ -472,3 +577,4 @@ class ewdufaqInit {
472
  global $ewd_ufaq_controller;
473
  $ewd_ufaq_controller = new ewdufaqInit();
474
 
 
1
  <?php
2
  /*
3
  Plugin Name: Ultimate FAQ - WordPress FAQ and Accordion Plugin
4
+ Plugin URI: https://www.etoilewebdesign.com/plugins/ultimate-faq/
5
  Description: FAQ and accordion plugin with easy to use Gutenberg blocks, shortcodes and widgets. Includes an advanced FAQ search and FAQ schema.
6
+ Author URI: https://www.etoilewebdesign.com/
7
  Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
8
  Text Domain: ultimate-faqs
9
+ Version: 2.1.0
10
  WC requires at least: 3.0
11
+ WC tested up to: 6.0
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) )
43
  define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
44
  define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
45
  define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
46
+ define( 'EWD_UFAQ_VERSION', '2.1.0' );
47
 
48
  define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
49
  define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
64
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/CustomPostTypes.class.php' );
65
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Dashboard.class.php' );
66
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/DeactivationSurvey.class.php' );
 
67
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/FAQ.class.php' );
 
68
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/InstallationWalkthrough.class.php' );
69
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Notifications.class.php' );
70
  require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/OrderingTable.class.php' );
109
 
110
  new ewdufaqAJAX();
111
  new ewdufaqBlocks();
 
 
112
  new ewdufaqNotifications();
113
  new ewdufaqOrderingTable();
114
  new ewdufaqUltimateWPMail();
127
  register_activation_hook( __FILE__, array( $this, 'run_walkthrough' ) );
128
  register_activation_hook( __FILE__, array( $this, 'convert_options' ) );
129
 
130
+ add_filter( 'ewd_ufaq_admin_menu', array( $this, 'admin_menu_optional' ) );
 
 
131
 
132
+ add_filter( 'init', array( $this, 'rewrite_rules' ) );
133
+ add_filter( 'query_vars', array( $this, 'add_query_vars' ) );
134
+ add_filter( 'redirect_canonical', array( $this, 'disable_canonical_redirect_for_front_page' ) );
135
 
136
+ add_filter( 'the_content', array( $this, 'alter_faq_content' ) );
137
+ add_action( 'wp_footer', array( $this, 'output_ld_json_content' ) );
138
 
139
+ add_action( 'init', array( $this, 'load_view_files' ) );
140
 
141
+ add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
 
142
 
143
+ add_action( 'admin_notices', array( $this, 'display_header_area' ) );
144
+ add_action( 'admin_notices', array( $this, 'maybe_display_helper_notice' ) );
 
145
 
146
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ), 10, 1 );
147
+ add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ) );
148
+ add_action( 'wp_head', 'ewd_add_frontend_ajax_url' );
149
+
150
+ add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2);
151
 
152
  add_action( 'wp_ajax_ewd_ufaq_hide_helper_notice', array( $this, 'hide_helper_notice' ) );
153
  }
178
  $frontpage_id = get_option( 'page_on_front' );
179
 
180
  add_rewrite_tag( '%single_faq%', '([^&]+)' );
181
+ add_rewrite_tag( '%ufaq_category_slug%', '([^+]+)' );
182
+ add_rewrite_tag( '%ufaq_tag_slug%', '([^?]+)' );
183
 
184
  add_rewrite_rule( "single-faq/([^&]*)/?$", "index.php?page_id=". $frontpage_id . "&single_faq=\$matches[1]", 'top' );
185
  add_rewrite_rule( "(.?.+?)/single-faq/([^&]*)/?$", "index.php?pagename=\$matches[1]&single_faq=\$matches[2]", 'top' );
270
  * @since 2.0.0
271
  */
272
  public function enqueue_admin_assets( $hook ) {
 
273
 
274
  wp_enqueue_script( 'ewd-ufaq-helper-notice', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-helper-install-notice.js', array( 'jquery' ), EWD_UFAQ_VERSION, true );
275
+ wp_localize_script(
276
+ 'ewd-ufaq-helper-notice',
277
+ 'ewd_ufaq_helper_notice',
278
+ array( 'nonce' => wp_create_nonce( 'ewd-ufaq-helper-notice' ) )
279
+ );
280
 
281
+ wp_enqueue_style( 'ewd-ufaq-helper-notice', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-helper-install-notice.css', array(), EWD_UFAQ_VERSION );
282
 
283
  $screen = get_current_screen();
284
 
285
+ $hooks = array(
286
+ 'widgets.php',
287
+ 'ufaq_page_ewd-ufaq-ordering-table',
288
+ 'ufaq_page_ewd-ufaq-settings'
289
+ );
290
+
291
+ $screen_ids = array(
292
+ 'ufaq_page_ewd-ufaq-dashboard',
293
+ 'edit-ufaq',
294
+ 'edit-ufaq-category',
295
+ 'edit-ufaq-tag',
296
+ 'ufaq_page_ewd-ufaq-export',
297
+ 'ufaq_page_ewd-ufaq-import'
298
+ );
299
+
300
+ if ( ! in_array( $hook, $hooks ) and ! in_array( $screen->id, $screen_ids ) ) { return; }
301
 
302
  wp_enqueue_style( 'ewd-ufaq-admin-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-admin.css', array(), EWD_UFAQ_VERSION );
303
 
423
  </div>
424
  <?php
425
  }
426
+
427
+ $menu_list = apply_filters(
428
+ 'ewd_ufaq_admin_menu',
429
+ array(
430
+ array(
431
+ 'id' => 'dashboard-menu',
432
+ 'label' => __("Dashboard", 'ultimate-faqs'),
433
+ 'url' => 'admin.php?page=ewd-ufaq-dashboard',
434
+ 'screen-id' => 'ufaq_ewd-ufaq-dashboard',
435
+ ),
436
+ array(
437
+ 'id' => 'faqs-menu',
438
+ 'label' => __("FAQs", 'ultimate-faqs'),
439
+ 'url' => 'edit.php?post_type=ufaq',
440
+ 'screen-id' => 'edit-ufaq',
441
+ ),
442
+ array(
443
+ 'id' => 'add-faq-menu',
444
+ 'label' => __("Add New", 'ultimate-faqs'),
445
+ 'url' => 'post-new.php?post_type=ufaq',
446
+ 'screen-id' => 'not-required',
447
+ ),
448
+ array(
449
+ 'id' => 'categories-menu',
450
+ 'label' => __("Categories", 'ultimate-faqs'),
451
+ 'url' => 'edit-tags.php?taxonomy=ufaq-category&post_type=ufaq',
452
+ 'screen-id' => 'edit-ufaq-category',
453
+ ),
454
+ array(
455
+ 'id' => 'tags-menu',
456
+ 'label' => __("Tags", 'ultimate-faqs'),
457
+ 'url' => 'edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq',
458
+ 'screen-id' => 'edit-ufaq-tag',
459
+ ),
460
+ array(
461
+ 'id' => 'options-menu',
462
+ 'label' => __("Settings", 'ultimate-faqs'),
463
+ 'url' => 'edit.php?post_type=ufaq&page=ewd-ufaq-settings',
464
+ 'screen-id' => 'ufaq_page_ewd-ufaq-settings',
465
+ )
466
+ )
467
+ );
468
+
469
  ?>
470
  <div class="ewd-ufaq-admin-header-menu">
471
  <h2 class="nav-tab-wrapper">
472
+ <a
473
+ id="ewd-ufaq-dash-mobile-menu-open"
474
+ href="#"
475
+ class="menu-tab nav-tab">
476
+ <?php _e("MENU", 'ultimate-faqs'); ?>
477
+ <span id="ewd-ufaq-dash-mobile-menu-down-caret">&nbsp;&nbsp;&#9660;</span>
478
+ <span id="ewd-ufaq-dash-mobile-menu-up-caret">&nbsp;&nbsp;&#9650;</span>
479
+ </a>
480
+
481
+ <?php
482
+ foreach ($menu_list as $menu) {
483
+ $active = $screen->id == $menu['screen-id'] ? 'nav-tab-active' : '';
484
+ ?>
485
+ <a
486
+ id='<?php echo esc_attr( $menu['id'] ); ?>'
487
+ href='<?php echo esc_attr( $menu['url'] ); ?>'
488
+ class='menu-tab nav-tab <?php echo esc_attr( $active ); ?>'>
489
+ <?php echo esc_html( $menu['label'] ); ?>
490
+ </a>
491
+ <?php
492
+ }
493
+ ?>
494
+
495
  </h2>
496
  </div>
497
  <?php
529
 
530
  public function hide_helper_notice() {
531
 
532
+ // Authenticate request
533
+ if (
534
+ ! check_ajax_referer( 'ewd-ufaq-helper-notice', 'nonce' )
535
+ ||
536
+ ! current_user_can( 'manage_options' )
537
+ ) {
538
+ wp_send_json_error(
539
+ array(
540
+ 'error' => 'loggedout',
541
+ 'msg' => sprintf( __( 'You have been logged out. Please %slogin again%s.', 'ultimate-faqs' ), '<a href="' . wp_login_url( admin_url( 'admin.php?page=ewd-ufaq-dashboard' ) ) . '">', '</a>' ),
542
+ )
543
+ );
544
+ }
545
+
546
  set_transient( 'ewd-helper-notice-dismissed', true, 3600*24*7 );
547
 
548
+ die();
549
+ }
550
+
551
+ public function admin_menu_optional( $menu_list )
552
+ {
553
+ global $ewd_ufaq_controller;
554
+
555
+ if ( $ewd_ufaq_controller->settings->get_setting( 'faq-order-by' ) == 'set_order' ) {
556
+ array_splice(
557
+ $menu_list,
558
+ count( $menu_list ) - 1,
559
+ 0,
560
+ array(
561
+ array(
562
+ 'id' => 'ordering-table',
563
+ 'label' => __("FAQ Order", 'ultimate-faqs'),
564
+ 'url' => 'edit.php?post_type=ufaq&page=ewd-ufaq-ordering-table',
565
+ 'screen-id' => 'ufaq_page_ewd-ufaq-ordering-table',
566
+ )
567
+ )
568
+ );
569
+ }
570
+
571
+ return $menu_list;
572
  }
573
 
574
  }
577
  global $ewd_ufaq_controller;
578
  $ewd_ufaq_controller = new ewdufaqInit();
579
 
580
+ do_action( 'ewd_ufaq_initialized' );