Ultimate FAQ - Version 2.0.22

Version Description

(2021-09-08) = - Updated the settings page library. - Made FAQ search input field type search, so it includes functionality such as the clear event. - Updated the conditional enqueuing of assets. - Update to the integration with the Ultimate WP Mail plugin for the submitted FAQ thank-you email. - Added ID to the category headings (when grouping FAQs by category), so you can anchor link directly to one. - Added a check on FAQ import for the post type, so you can't accidentally overwrite an existing post if you mistakenly specify a post ID that already exists for a post in another post type.

Download this release

Release Info

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

Code changes from version 2.0.21 to 2.0.22

Files changed (47) hide show
  1. assets/img/ewd-otp-icon.png +0 -0
  2. ewd-ufaq-templates/faqs-category-header.php +1 -1
  3. ewd-ufaq-templates/faqs-search.php +1 -1
  4. includes/Dashboard.class.php +9 -9
  5. includes/Import.class.php +2 -0
  6. includes/Notifications.class.php +4 -4
  7. includes/Settings.class.php +1 -1
  8. lib/simple-admin-pages/.gitignore +50 -0
  9. lib/simple-admin-pages/classes/AdminPage.Menu.class.php +1 -1
  10. lib/simple-admin-pages/classes/AdminPage.Submenu.class.php +1 -1
  11. lib/simple-admin-pages/classes/AdminPage.Themes.class.php +1 -1
  12. lib/simple-admin-pages/classes/AdminPage.class.php +1 -1
  13. lib/simple-admin-pages/classes/AdminPageSection.class.php +1 -1
  14. lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php +1 -1
  15. lib/simple-admin-pages/classes/AdminPageSetting.Checkbox.class.php +12 -1
  16. lib/simple-admin-pages/classes/AdminPageSetting.ColorPicker.class.php +1 -1
  17. lib/simple-admin-pages/classes/AdminPageSetting.Count.class.php +16 -10
  18. lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php +1 -1
  19. lib/simple-admin-pages/classes/AdminPageSetting.FileUpload.class.php +1 -1
  20. lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php +1 -1
  21. lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php +1 -1
  22. lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php +56 -9
  23. lib/simple-admin-pages/classes/AdminPageSetting.McApiKey.class.php +1 -1
  24. lib/simple-admin-pages/classes/AdminPageSetting.McListMerge.class.php +1 -1
  25. lib/simple-admin-pages/classes/AdminPageSetting.Number.class.php +1 -1
  26. lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php +1 -1
  27. lib/simple-admin-pages/classes/AdminPageSetting.Ordering.class.php +1 -1
  28. lib/simple-admin-pages/classes/AdminPageSetting.Radio.class.php +1 -1
  29. lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php +1 -1
  30. lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php +1 -1
  31. lib/simple-admin-pages/classes/AdminPageSetting.SelectMenu.class.php +1 -1
  32. lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php +1 -1
  33. lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php +1 -1
  34. lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php +1 -1
  35. lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php +1 -1
  36. lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php +1 -1
  37. lib/simple-admin-pages/classes/AdminPageSetting.WarningTip.class.php +1 -1
  38. lib/simple-admin-pages/classes/AdminPageSetting.class.php +1 -1
  39. lib/simple-admin-pages/classes/Library.class.php +4 -4
  40. lib/simple-admin-pages/img/options-asset-exclamation.png +0 -0
  41. lib/simple-admin-pages/js/admin-settings.js +4 -1
  42. lib/simple-admin-pages/js/infinite_table.js +5 -3
  43. readme.txt +8 -0
  44. ultimate-faqs.php +4 -4
  45. views/View.FAQ.class.php +4 -0
  46. views/View.FAQs.class.php +12 -0
  47. views/View.SubmitFAQ.class.php +2 -0
assets/img/ewd-otp-icon.png ADDED
Binary file
ewd-ufaq-templates/faqs-category-header.php CHANGED
@@ -1,4 +1,4 @@
1
- <div class='ewd-ufaq-faq-category'>
2
 
3
  <div class='ewd-ufaq-faq-category-title <?php echo ( $this->get_option( 'faq-category-toggle' ) ? 'ewd-ufaq-faq-category-title-toggle' : '' ); ?>' >
4
 
1
+ <div id='ewd-ufaq-faq-category-<?php echo esc_attr( $this->get_category_slug() ); ?>' class='ewd-ufaq-faq-category'>
2
 
3
  <div class='ewd-ufaq-faq-category-title <?php echo ( $this->get_option( 'faq-category-toggle' ) ? 'ewd-ufaq-faq-category-title-toggle' : '' ); ?>' >
4
 
ewd-ufaq-templates/faqs-search.php CHANGED
@@ -6,7 +6,7 @@
6
 
7
  <?php $this->maybe_print_shortcode_args(); ?>
8
 
9
- <input type='text' class='ewd-ufaq-text-input <?php echo ( $this->get_option( 'auto-complete-titles' ) ? 'ewd-ufaq-text-auto-complete' : '' ); ?>' placeholder='<?php echo esc_attr( $this->get_label( 'label-search-placeholder' ) ); ?>' value='<?php echo ( isset( $_GET['faq_search_term'] ) ? esc_attr( $_GET['faq_search_term'] ) : '' ); ?>' />
10
 
11
  <?php $this->maybe_print_search_submit(); ?>
12
 
6
 
7
  <?php $this->maybe_print_shortcode_args(); ?>
8
 
9
+ <input type='search' class='ewd-ufaq-text-input <?php echo ( $this->get_option( 'auto-complete-titles' ) ? 'ewd-ufaq-text-auto-complete' : '' ); ?>' placeholder='<?php echo esc_attr( $this->get_label( 'label-search-placeholder' ) ); ?>' value='<?php echo ( isset( $_GET['faq_search_term'] ) ? esc_attr( $_GET['faq_search_term'] ) : '' ); ?>' />
10
 
11
  <?php $this->maybe_print_search_submit(); ?>
12
 
includes/Dashboard.class.php CHANGED
@@ -169,7 +169,7 @@ class ewdufaqDashboard {
169
  </div>
170
  </div>
171
 
172
- <div class="ewd-ufaq-dashboard-new-widget-box <?php echo ( ($hideReview != 'Yes' and $Ask_Review_Date < time()) ? 'ewd-widget-box-two-thirds' : 'ewd-widget-box-full' ); ?>">
173
  <div class="ewd-ufaq-dashboard-new-widget-box-top">What People Are Saying</div>
174
  <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
175
  <ul class="ewd-ufaq-dashboard-testimonials">
@@ -243,27 +243,27 @@ class ewdufaqDashboard {
243
  </div>
244
  <?php } ?>
245
 
246
- <!-- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">
247
  <div class="ewd-ufaq-dashboard-new-widget-box-top">Other Plugins by Etoile</div>
248
  <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
249
  <ul class="ewd-ufaq-dashboard-other-plugins">
250
  <li>
251
- <a href="https://wordpress.org/plugins/ultimate-product-catalogue/" target="_blank"><img src="<?php echo plugins_url( '../images/ewd-ufaq-icon.png', __FILE__ ); ?>"></a>
252
  <div class="ewd-ufaq-dashboard-other-plugins-text">
253
- <div class="ewd-ufaq-dashboard-other-plugins-title">Product Catalog</div>
254
- <div class="ewd-ufaq-dashboard-other-plugins-blurb">Enables you to display your business's products in a clean and efficient manner.</div>
255
  </div>
256
  </li>
257
  <li>
258
- <a href="https://wordpress.org/plugins/ultimate-faqs/" target="_blank"><img src="<?php echo plugins_url( '../images/ewd-ufaq-icon.png', __FILE__ ); ?>"></a>
259
  <div class="ewd-ufaq-dashboard-other-plugins-text">
260
- <div class="ewd-ufaq-dashboard-other-plugins-title">Ultimate FAQs</div>
261
- <div class="ewd-ufaq-dashboard-other-plugins-blurb">Let visitors submit reviews and display them right in the tabbed page layout!</div>
262
  </div>
263
  </li>
264
  </ul>
265
  </div>
266
- </div> -->
267
 
268
  </div> <!-- right -->
269
 
169
  </div>
170
  </div>
171
 
172
+ <div class="ewd-ufaq-dashboard-new-widget-box <?php echo ( ($hideReview != 'Yes' and $Ask_Review_Date < time()) ? 'ewd-widget-box-full' : 'ewd-widget-box-full' ); ?>">
173
  <div class="ewd-ufaq-dashboard-new-widget-box-top">What People Are Saying</div>
174
  <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
175
  <ul class="ewd-ufaq-dashboard-testimonials">
243
  </div>
244
  <?php } ?>
245
 
246
+ <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">
247
  <div class="ewd-ufaq-dashboard-new-widget-box-top">Other Plugins by Etoile</div>
248
  <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
249
  <ul class="ewd-ufaq-dashboard-other-plugins">
250
  <li>
251
+ <a href="https://wordpress.org/plugins/ultimate-reviews/" target="_blank"><img src="<?php echo plugins_url( '../assets/img/ewd-urp-icon.png', __FILE__ ); ?>"></a>
252
  <div class="ewd-ufaq-dashboard-other-plugins-text">
253
+ <div class="ewd-ufaq-dashboard-other-plugins-title">Ultimate Reviews</div>
254
+ <div class="ewd-ufaq-dashboard-other-plugins-blurb">Easily add a full reviewing system to your website. Also can be used to replace the default WooCommerce review system.</div>
255
  </div>
256
  </li>
257
  <li>
258
+ <a href="https://wordpress.org/plugins/order-tracking/" target="_blank"><img src="<?php echo plugins_url( '../assets/img/ewd-otp-icon.png', __FILE__ ); ?>"></a>
259
  <div class="ewd-ufaq-dashboard-other-plugins-text">
260
+ <div class="ewd-ufaq-dashboard-other-plugins-title">Order Tracking</div>
261
+ <div class="ewd-ufaq-dashboard-other-plugins-blurb">Add a full order tracking system to your site. Integrates directly with WooCommerce for automatic order creation and status updates.</div>
262
  </div>
263
  </li>
264
  </ul>
265
  </div>
266
+ </div>
267
 
268
  </div> <!-- right -->
269
 
includes/Import.class.php CHANGED
@@ -152,6 +152,8 @@ class ewdufaqImport {
152
  }
153
  }
154
 
 
 
155
  $post['post_status'] = 'publish';
156
  $post['post_type'] = EWD_UFAQ_FAQ_POST_TYPE;
157
 
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
 
includes/Notifications.class.php CHANGED
@@ -57,14 +57,14 @@ class ewdufaqNotifications {
57
  if ( ! $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ) ) { return; }
58
 
59
  $params = array(
60
- 'Email_ID' => $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ),
61
- 'Email_Address' => $faq->faq_author_email,
62
  'post_id' => $faq->ID
63
  );
64
 
65
- if ( function_exists( 'EWD_UWPM_Send_Email_To_Non_User' ) ) {
66
 
67
- EWD_UWPM_Send_Email_To_Non_User( $params );
68
  }
69
  }
70
  }
57
  if ( ! $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ) ) { return; }
58
 
59
  $params = array(
60
+ 'email_id' => $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ),
61
+ 'email_address' => $faq->faq_author_email,
62
  'post_id' => $faq->ID
63
  );
64
 
65
+ if ( function_exists( 'ewd_uwpm_send_email' ) ) {
66
 
67
+ ewd_uwpm_send_email( $params );
68
  }
69
  }
70
  }
includes/Settings.class.php CHANGED
@@ -131,7 +131,7 @@ class ewdufaqSettings {
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.5.0',
135
  'lib_url' => EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/',
136
  )
137
  );
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.5.3',
135
  'lib_url' => EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/',
136
  )
137
  );
lib/simple-admin-pages/.gitignore ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # These are some examples of commonly ignored file patterns.
2
+ # You should customize this list as applicable to your project.
3
+ # Learn more about .gitignore:
4
+ # https://www.atlassian.com/git/tutorials/saving-changes/gitignore
5
+
6
+ # Node artifact files
7
+ node_modules/
8
+ dist/
9
+
10
+ # Compiled Java class files
11
+ *.class
12
+
13
+ # Compiled Python bytecode
14
+ *.py[cod]
15
+
16
+ # Log files
17
+ *.log
18
+
19
+ # Package files
20
+ *.jar
21
+
22
+ # Maven
23
+ target/
24
+ dist/
25
+
26
+ # JetBrains IDE
27
+ .idea/
28
+
29
+ # Unit test reports
30
+ TEST*.xml
31
+
32
+ # Generated by MacOS
33
+ .DS_Store
34
+
35
+ # Generated by Windows
36
+ Thumbs.db
37
+
38
+ # Applications
39
+ *.app
40
+ *.exe
41
+ *.war
42
+
43
+ # Large media files
44
+ *.mp4
45
+ *.tiff
46
+ *.avi
47
+ *.flv
48
+ *.mov
49
+ *.wmv
50
+
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_5_0 extends sapAdminPage_2_5_0 {
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_5_3 extends sapAdminPage_2_5_3 {
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_5_0 extends sapAdminPage_2_5_0 {
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_5_3 extends sapAdminPage_2_5_3 {
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_5_0 extends sapAdminPage_2_5_0 {
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_5_3 extends sapAdminPage_2_5_3 {
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_5_0 {
11
 
12
  public $title;
13
  public $menu_title;
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPage_2_5_3 {
11
 
12
  public $title;
13
  public $menu_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_5_0 {
11
 
12
  // Page defaults
13
  public $id; // unique id for this section
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSection_2_5_3 {
11
 
12
  // Page defaults
13
  public $id; // unique id for this section
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_5_0 extends sapAdminPageSetting_2_5_0 {
11
 
12
  /*
13
  * Size of this textarea
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingAddress_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
23
 
24
  //public $sanitize_callback = 'sanitize_text_field';
25
 
@@ -53,4 +53,15 @@ class sapAdminPageSettingCheckbox_2_5_0 extends sapAdminPageSetting_2_5_0 {
53
  return is_array( $values ) ? array_map( $this->sanitize_callback, $values ) : array();
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingCheckbox_2_5_3 extends sapAdminPageSetting_2_5_3 {
23
 
24
  //public $sanitize_callback = 'sanitize_text_field';
25
 
53
  return is_array( $values ) ? array_map( $this->sanitize_callback, $values ) : array();
54
  }
55
 
56
+ /**
57
+ * Escape the value to display it safely HTML textarea fields
58
+ */
59
+ public function esc_value( $values ) {
60
+
61
+ $return = is_array( $values ) ? array_map( 'esc_attr', $values ) : $values;
62
+ $return = is_string( $return ) ? esc_attr( $return ) : $return;
63
+
64
+ return $return;
65
+ }
66
+
67
  }
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_5_0 extends sapAdminPageSetting_2_5_0 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingColorPicker_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
28
 
29
  public $sanitize_callback = 'sanitize_text_field';
30
 
@@ -87,17 +87,23 @@ class sapAdminPageSettingCount_2_5_0 extends sapAdminPageSetting_2_5_0 {
87
  </select>
88
 
89
  <?php if ( ! empty($this->units) ) { ?>
90
- <select id="<?php echo $this->id; ?>_unit" <?php echo ( $this->disabled ? 'disabled' : ''); ?> class='sap-count-unit' data-id='<?php echo $this->id; ?>'>
91
 
92
- <?php if ( $this->blank_option === true ) : ?>
93
- <option></option>
94
- <?php endif; ?>
95
-
96
- <?php foreach ( $this->units as $id => $title ) : ?>
97
- <option value="<?php echo esc_attr( $id ); ?>"<?php if( $unit == $id ) : ?> selected="selected"<?php endif; ?>><?php echo esc_html( $title ); ?></option>
98
- <?php endforeach; ?>
 
 
 
 
 
 
 
 
99
 
100
- </select>
101
  <?php } ?>
102
  <?php $this->display_disabled(); ?>
103
  </fieldset>
24
  * @package Simple Admin Pages
25
  */
26
 
27
+ class sapAdminPageSettingCount_2_5_3 extends sapAdminPageSetting_2_5_3 {
28
 
29
  public $sanitize_callback = 'sanitize_text_field';
30
 
87
  </select>
88
 
89
  <?php if ( ! empty($this->units) ) { ?>
 
90
 
91
+ <?php if ( sizeof( $this->units ) == 1 ) { ?>
92
+ <input type='hidden' id='<?php echo $this->id; ?>_unit' data-id='<?php echo $this->id; ?>' /><span><?php echo esc_html( reset( $this->units ) ); ?></span>
93
+ <?php } else { ?>
94
+ <select id='<?php echo $this->id; ?>_unit' <?php echo ( $this->disabled ? 'disabled' : ''); ?> class='sap-count-unit' data-id='<?php echo $this->id; ?>'>
95
+
96
+ <?php if ( $this->blank_option === true ) : ?>
97
+ <option></option>
98
+ <?php endif; ?>
99
+
100
+ <?php foreach ( $this->units as $id => $title ) : ?>
101
+ <option value='<?php echo esc_attr( $id ); ?>' <?php if( $unit == $id ) : ?> selected="selected"<?php endif; ?>><?php echo esc_html( $title ); ?></option>
102
+ <?php endforeach; ?>
103
+
104
+ </select>
105
+ <?php } ?>
106
 
 
107
  <?php } ?>
108
  <?php $this->display_disabled(); ?>
109
  </fieldset>
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_5_0 extends sapAdminPageSetting_2_5_0 {
11
 
12
  public $sanitize_callback = 'wp_kses_post';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingEditor_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
19
 
20
  public $sanitize_callback = 'esc_url_raw';
21
 
15
  * @package Simple Admin Pages
16
  */
17
 
18
+ class sapAdminPageSettingFileUpload_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
18
 
19
  public $sanitize_callback = 'sanitize_text_field';
20
 
14
  * @package Simple Admin Pages
15
  */
16
 
17
+ class sapAdminPageSettingHTML_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
11
 
12
  public $sanitize_callback = 'absint';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingImage_2_5_3 extends sapAdminPageSetting_2_5_3 {
11
 
12
  public $sanitize_callback = 'absint';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php CHANGED
@@ -24,9 +24,9 @@
24
  * @package Simple Admin Pages
25
  */
26
 
27
- class sapAdminPageSettingInfiniteTable_2_5_0 extends sapAdminPageSetting_2_5_0 {
28
 
29
- public $sanitize_callback = 'sanitize_text_field';
30
 
31
  /**
32
  * Add in the JS requried for rows to be added and the values to be stored
@@ -71,7 +71,7 @@ class sapAdminPageSettingInfiniteTable_2_5_0 extends sapAdminPageSetting_2_5_0 {
71
  $fields .= $field_id . ",";
72
  }
73
  $fields = trim($fields, ',');
74
-
75
  ?>
76
 
77
  <fieldset>
@@ -94,17 +94,25 @@ class sapAdminPageSettingInfiniteTable_2_5_0 extends sapAdminPageSetting_2_5_0 {
94
  <?php if ($field['type'] == 'text') : ?>
95
  <input type='text' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
96
  <?php endif; ?>
 
 
 
97
  <?php if ($field['type'] == 'hidden') : ?>
98
  <span class='sap-infinite-table-hidden-value'><?php echo $row->$field_id; ?></span>
99
  <input type='hidden' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
100
  <?php endif; ?>
101
  <?php if ($field['type'] == 'select') : ?>
102
  <select data-name='<?php echo $field_id; ?>'>
103
- <?php foreach ($field['options'] as $option_value => $option_name) { ?>
104
- <option value='<?php echo $option_value; ?>' <?php echo ($row->$field_id == $option_value ? 'selected="selected"' : ''); ?>><?php echo $option_name; ?></option>
105
- <?php }?>
106
  </select>
107
  <?php endif; ?>
 
 
 
 
 
 
108
  </td>
109
  <?php } ?>
110
  <td class='sap-infinite-table-row-delete'><?php echo $this->del_label; ?></td>
@@ -118,17 +126,25 @@ class sapAdminPageSettingInfiniteTable_2_5_0 extends sapAdminPageSetting_2_5_0 {
118
  <?php if ($field['type'] == 'text') : ?>
119
  <input type='text' data-name='<?php echo $field_id; ?>' value='' />
120
  <?php endif; ?>
 
 
 
121
  <?php if ($field['type'] == 'hidden') : ?>
122
  <span class='sap-infinite-table-hidden-value'></span>
123
  <input type='hidden' data-name='<?php echo $field_id; ?>' value='' />
124
  <?php endif; ?>
125
  <?php if ($field['type'] == 'select') : ?>
126
  <select data-name='<?php echo $field_id; ?>'>
127
- <?php foreach ($field['options'] as $option_value => $option_name) { ?>
128
- <option value='<?php echo $option_value; ?>'><?php echo $option_name; ?></option>
129
- <?php }?>
130
  </select>
131
  <?php endif; ?>
 
 
 
 
 
 
132
  </td>
133
  <?php } ?>
134
  <td class='sap-infinite-table-row-delete'><?php echo $this->del_label; ?></td>
@@ -151,4 +167,35 @@ class sapAdminPageSettingInfiniteTable_2_5_0 extends sapAdminPageSetting_2_5_0 {
151
 
152
  }
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
24
  * @package Simple Admin Pages
25
  */
26
 
27
+ class sapAdminPageSettingInfiniteTable_2_5_3 extends sapAdminPageSetting_2_5_3 {
28
 
29
+ public $sanitize_callback = 'sanitize_textarea_field';
30
 
31
  /**
32
  * Add in the JS requried for rows to be added and the values to be stored
71
  $fields .= $field_id . ",";
72
  }
73
  $fields = trim($fields, ',');
74
+
75
  ?>
76
 
77
  <fieldset>
94
  <?php if ($field['type'] == 'text') : ?>
95
  <input type='text' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
96
  <?php endif; ?>
97
+ <?php if ($field['type'] == 'textarea') : ?>
98
+ <textarea data-name='<?php echo $field_id; ?>'><?php echo $row->$field_id; ?></textarea>
99
+ <?php endif; ?>
100
  <?php if ($field['type'] == 'hidden') : ?>
101
  <span class='sap-infinite-table-hidden-value'><?php echo $row->$field_id; ?></span>
102
  <input type='hidden' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
103
  <?php endif; ?>
104
  <?php if ($field['type'] == 'select') : ?>
105
  <select data-name='<?php echo $field_id; ?>'>
106
+ <?php if ( ! empty( $field['blank_option'] ) ) { ?><option></option><?php } ?>
107
+ <?php $this->print_options( $field['options'], $row, $field_id ); ?>
 
108
  </select>
109
  <?php endif; ?>
110
+ <?php if ($field['type'] == 'toggle') : ?>
111
+ <label class="sap-admin-switch">
112
+ <input type="checkbox" class="sap-admin-option-toggle" data-name="<?php echo $field_id; ?>" <?php if( $row->$field_id == '1' ) {echo "checked='checked'";} ?> >
113
+ <span class="sap-admin-switch-slider round"></span>
114
+ </label>
115
+ <?php endif; ?>
116
  </td>
117
  <?php } ?>
118
  <td class='sap-infinite-table-row-delete'><?php echo $this->del_label; ?></td>
126
  <?php if ($field['type'] == 'text') : ?>
127
  <input type='text' data-name='<?php echo $field_id; ?>' value='' />
128
  <?php endif; ?>
129
+ <?php if ($field['type'] == 'textarea') : ?>
130
+ <textarea data-name='<?php echo $field_id; ?>'></textarea>
131
+ <?php endif; ?>
132
  <?php if ($field['type'] == 'hidden') : ?>
133
  <span class='sap-infinite-table-hidden-value'></span>
134
  <input type='hidden' data-name='<?php echo $field_id; ?>' value='' />
135
  <?php endif; ?>
136
  <?php if ($field['type'] == 'select') : ?>
137
  <select data-name='<?php echo $field_id; ?>'>
138
+ <?php if ( ! empty( $field['blank_option'] ) ) { ?><option></option><?php } ?>
139
+ <?php $this->print_options( $field['options'] ); ?>
 
140
  </select>
141
  <?php endif; ?>
142
+ <?php if ($field['type'] == 'toggle') : ?>
143
+ <label class="sap-admin-switch">
144
+ <input type="checkbox" class="sap-admin-option-toggle" data-name="<?php echo $field_id; ?>" checked >
145
+ <span class="sap-admin-switch-slider round"></span>
146
+ </label>
147
+ <?php endif; ?>
148
  </td>
149
  <?php } ?>
150
  <td class='sap-infinite-table-row-delete'><?php echo $this->del_label; ?></td>
167
 
168
  }
169
 
170
+ /**
171
+ * Recursively print out select options
172
+ * @since 2.5.3
173
+ */
174
+ public function print_options( $options, $row = false, $field_id = 0 ) {
175
+
176
+ foreach ( $options as $option_value => $option_name ) {
177
+
178
+ if ( is_array( $option_name ) ) { ?>
179
+
180
+ <optgroup label='<?php echo esc_attr( $option_value ); ?>'>
181
+ <?php $this->print_options( $option_name, $row, $field_id ); ?>
182
+ </optgroup>
183
+
184
+ <?php
185
+
186
+ continue;
187
+ }
188
+
189
+ $selected_value = $row ? $row->$field_id : false;
190
+
191
+ ?>
192
+
193
+ <option value='<?php echo $option_value; ?>' <?php echo ($selected_value == $option_value ? 'selected="selected"' : ''); ?>>
194
+ <?php echo $option_name; ?>
195
+ </option>
196
+
197
+ <?php
198
+ }
199
+ }
200
+
201
  }
lib/simple-admin-pages/classes/AdminPageSetting.McApiKey.class.php CHANGED
@@ -14,7 +14,7 @@
14
  *
15
  */
16
 
17
- class mcfrtbAdminPageSettingMcApiKey_2_5_0 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
14
  *
15
  */
16
 
17
+ class mcfrtbAdminPageSettingMcApiKey_2_5_3 {
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_5_0 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
14
  *
15
  */
16
 
17
+ class mcfrtbAdminPageSettingMcListMerge_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingNumber_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
29
 
30
  public $sanitize_callback = 'sanitize_text_field';
31
 
25
  * @package Simple Admin Pages
26
  */
27
 
28
+ class sapAdminPageSettingOpeningHours_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
22
 
23
  public $sanitize_callback = 'sanitize_text_field';
24
 
18
  * @package Simple Admin Pages
19
  */
20
 
21
+ class sapAdminPageSettingOrdering_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
23
 
24
  public $sanitize_callback = 'sanitize_text_field';
25
 
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingRadio_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
14
 
15
  public $sanitize_callback = 'sanitize_text_field';
16
 
10
  * @package Simple Admin Pages
11
  */
12
 
13
+ class sapAdminPageSettingScheduler_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
25
 
26
  public $sanitize_callback = 'sanitize_text_field';
27
 
21
  * @package Simple Admin Pages
22
  */
23
 
24
+ class sapAdminPageSettingSelect_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingSelectMenu_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingSelectPost_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
23
 
24
  public $sanitize_callback = 'intval';
25
 
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingSelectTaxonomy_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingText_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
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_5_3 extends sapAdminPageSetting_2_5_3 {
13
 
14
  /*
15
  * Size of this textarea
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_5_0 extends sapAdminPageSetting_2_5_0 {
21
 
22
  public $sanitize_callback = 'sanitize_text_field';
23
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingToggle_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 extends sapAdminPageSetting_2_5_0 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingWarningTip_2_5_3 extends sapAdminPageSetting_2_5_3 {
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_5_0 {
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_5_3 {
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_5_0' ) ) {
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_5_0' ) ) {
7
  * @since 1.0
8
  * @package Simple Admin Pages
9
  */
10
- class sapLibrary_2_5_0 {
11
 
12
  // Version of the library
13
- private $version = '2.5.0';
14
 
15
  // A full URL to the library which is used to correctly link scripts and
16
  // stylesheets.
@@ -42,7 +42,7 @@ class sapLibrary_2_5_0 {
42
  public function __construct( $args ) {
43
 
44
  if ( ! defined( 'SAP_VERSION' ) ) {
45
- define( 'SAP_VERSION', '2.5.0' );
46
  }
47
 
48
  // 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_5_3' ) ) {
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_5_3 {
11
 
12
  // Version of the library
13
+ private $version = '2.5.3';
14
 
15
  // A full URL to the library which is used to correctly link scripts and
16
  // stylesheets.
42
  public function __construct( $args ) {
43
 
44
  if ( ! defined( 'SAP_VERSION' ) ) {
45
+ define( 'SAP_VERSION', '2.5.3' );
46
  }
47
 
48
  // If no URL path to the library is passed, we won't be able to add the
lib/simple-admin-pages/img/options-asset-exclamation.png ADDED
Binary file
lib/simple-admin-pages/js/admin-settings.js CHANGED
@@ -1,4 +1,7 @@
1
  jQuery(document).ready(function() {
 
 
 
2
  jQuery('.sap-spectrum').spectrum({
3
  showInput: true,
4
  showInitial: true,
@@ -44,7 +47,7 @@ function EWD_SAP_hexToRgb(hex) {
44
  //OPTIONS PAGE YES/NO TOGGLE SWITCHES
45
  jQuery(document).ready(function($){
46
  $('.sap-admin-option-toggle').on('change', function() {
47
- var Input_Name = $(this).data('inputname');
48
  if ($(this).is(':checked')) {
49
  $('input[name="' + Input_Name + '"][value="1"]').prop('checked', true).trigger('change');
50
  $('input[name="' + Input_Name + '"][value=""]').prop('checked', false);
1
  jQuery(document).ready(function() {
2
+
3
+ if ( ! jQuery.isFunction( jQuery.fn.spectrum ) ) { return; }
4
+
5
  jQuery('.sap-spectrum').spectrum({
6
  showInput: true,
7
  showInitial: true,
47
  //OPTIONS PAGE YES/NO TOGGLE SWITCHES
48
  jQuery(document).ready(function($){
49
  $('.sap-admin-option-toggle').on('change', function() {
50
+ var Input_Name = $(this).data('inputname'); console.log(Input_Name);
51
  if ($(this).is(':checked')) {
52
  $('input[name="' + Input_Name + '"][value="1"]').prop('checked', true).trigger('change');
53
  $('input[name="' + Input_Name + '"][value=""]').prop('checked', false);
lib/simple-admin-pages/js/infinite_table.js CHANGED
@@ -29,17 +29,19 @@ jQuery(document).ready(function ($) {
29
  let record = {}; ignore = false;
30
 
31
  $(tr).find('td').each((idx_td, td) => {
32
- let elm = $(td).find('select, input');
33
 
34
  ignore = 'cf_field_name' == elm.data('name') && elm.val().length < 1 ? true : ignore;
35
 
36
  if(!ignore) {
37
- record[elm.data('name')] = elm.val();
 
 
38
  }
39
  });
40
 
41
  !ignore ? main_input_val.push(record) : null;
42
- });
43
 
44
  main_input.val(JSON.stringify(main_input_val));
45
 
29
  let record = {}; ignore = false;
30
 
31
  $(tr).find('td').each((idx_td, td) => {
32
+ let elm = $(td).find('select, input, textarea, checkbox');
33
 
34
  ignore = 'cf_field_name' == elm.data('name') && elm.val().length < 1 ? true : ignore;
35
 
36
  if(!ignore) {
37
+
38
+ if ( elm.prop( 'type' ) == 'checkbox' ) { record[ elm.data('name') ] = elm.is( ':checked' ); }
39
+ else { record[elm.data('name')] = elm.val(); }
40
  }
41
  });
42
 
43
  !ignore ? main_input_val.push(record) : null;
44
+ });
45
 
46
  main_input.val(JSON.stringify(main_input_val));
47
 
readme.txt CHANGED
@@ -264,6 +264,14 @@ Video 3 - FAQs Ordering
264
 
265
  == Changelog ==
266
 
 
 
 
 
 
 
 
 
267
  = 2.0.21 (2021-08-12) =
268
  - Updated deprecated block_categories.
269
 
264
 
265
  == Changelog ==
266
 
267
+ = 2.0.22 (2021-09-08) =
268
+ - Updated the settings page library.
269
+ - Made FAQ search input field type search, so it includes functionality such as the clear event.
270
+ - Updated the conditional enqueuing of assets.
271
+ - Update to the integration with the Ultimate WP Mail plugin for the submitted FAQ thank-you email.
272
+ - Added ID to the category headings (when grouping FAQs by category), so you can anchor link directly to one.
273
+ - Added a check on FAQ import for the post type, so you can't accidentally overwrite an existing post if you mistakenly specify a post ID that already exists for a post in another post type.
274
+
275
  = 2.0.21 (2021-08-12) =
276
  - Updated deprecated block_categories.
277
 
ultimate-faqs.php CHANGED
@@ -7,7 +7,7 @@ Author: Etoile Web Design
7
  Author URI: http://www.EtoileWebDesign.com/plugins/ultimate-faqs/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: ultimate-faqs
10
- Version: 2.0.21
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) )
@@ -300,8 +300,8 @@ class ewdufaqInit {
300
  function register_assets() {
301
  global $ewd_ufaq_controller;
302
 
303
- wp_enqueue_style( 'ewd-ufaq-rrssb', EWD_UFAQ_PLUGIN_URL . '/assets/css/rrssb-min.css', EWD_UFAQ_VERSION );
304
- wp_enqueue_style( 'ewd-ufaq-jquery-ui', EWD_UFAQ_PLUGIN_URL . '/assets/css/jquery-ui.min.css', EWD_UFAQ_VERSION );
305
  wp_register_style( 'ewd-ufaq-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq.css', EWD_UFAQ_VERSION );
306
 
307
  wp_register_script( 'ewd-ufaq-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq.js', array( 'jquery', 'jquery-ui-core' ), EWD_UFAQ_VERSION, true );
@@ -364,7 +364,7 @@ class ewdufaqInit {
364
  'mainEntity' => $this->schema_faq_data
365
  );
366
 
367
- $ld_json_ouptut = apply_filters( 'bpfwp_ld_json_output', $ewd_ufaq_schema_data );
368
 
369
  echo '<script type="application/ld+json" class="ewd-ufaq-ld-json-data">';
370
  echo wp_json_encode( $ld_json_ouptut );
7
  Author URI: http://www.EtoileWebDesign.com/plugins/ultimate-faqs/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: ultimate-faqs
10
+ Version: 2.0.22
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) )
300
  function register_assets() {
301
  global $ewd_ufaq_controller;
302
 
303
+ wp_register_style( 'ewd-ufaq-rrssb', EWD_UFAQ_PLUGIN_URL . '/assets/css/rrssb-min.css', EWD_UFAQ_VERSION );
304
+ wp_register_style( 'ewd-ufaq-jquery-ui', EWD_UFAQ_PLUGIN_URL . '/assets/css/jquery-ui.min.css', EWD_UFAQ_VERSION );
305
  wp_register_style( 'ewd-ufaq-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq.css', EWD_UFAQ_VERSION );
306
 
307
  wp_register_script( 'ewd-ufaq-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq.js', array( 'jquery', 'jquery-ui-core' ), EWD_UFAQ_VERSION, true );
364
  'mainEntity' => $this->schema_faq_data
365
  );
366
 
367
+ $ld_json_ouptut = apply_filters( 'ewd_ufaq_ld_json_output', $ewd_ufaq_schema_data );
368
 
369
  echo '<script type="application/ld+json" class="ewd-ufaq-ld-json-data">';
370
  echo wp_json_encode( $ld_json_ouptut );
views/View.FAQ.class.php CHANGED
@@ -670,6 +670,8 @@ class ewdufaqViewFAQ extends ewdufaqView {
670
  $this->no_comments = ! empty( $this->no_comments ) ? $this->no_comments : ! $ewd_ufaq_controller->settings->get_setting( 'comments-on' );
671
  $this->display_all_answers = ! empty( $this->display_all_answers ) ? $this->display_all_answers : $ewd_ufaq_controller->settings->get_setting( 'display-all-answers' );
672
 
 
 
673
  $this->add_faq_permalink();
674
 
675
  if ( ! empty( $this->single_post ) ) { $this->display_all_answers = true; }
@@ -739,6 +741,8 @@ class ewdufaqViewFAQ extends ewdufaqView {
739
  */
740
  public function enqueue_assets() {
741
 
 
 
742
  wp_enqueue_style( 'ewd-ufaq-css' );
743
 
744
  wp_enqueue_script( 'ewd-ufaq-js' );
670
  $this->no_comments = ! empty( $this->no_comments ) ? $this->no_comments : ! $ewd_ufaq_controller->settings->get_setting( 'comments-on' );
671
  $this->display_all_answers = ! empty( $this->display_all_answers ) ? $this->display_all_answers : $ewd_ufaq_controller->settings->get_setting( 'display-all-answers' );
672
 
673
+ $this->current_url = ! empty( $this->current_url ) ? $this->current_url : get_permalink();
674
+
675
  $this->add_faq_permalink();
676
 
677
  if ( ! empty( $this->single_post ) ) { $this->display_all_answers = true; }
741
  */
742
  public function enqueue_assets() {
743
 
744
+ wp_enqueue_style( 'ewd-ufaq-rrssb' );
745
+ wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
746
  wp_enqueue_style( 'ewd-ufaq-css' );
747
 
748
  wp_enqueue_script( 'ewd-ufaq-js' );
views/View.FAQs.class.php CHANGED
@@ -319,6 +319,16 @@ class ewdufaqViewFAQs extends ewdufaqView {
319
  return ! empty( $this->current_category ) ? $this->current_category->name : '';
320
  }
321
 
 
 
 
 
 
 
 
 
 
 
322
  /**
323
  * Get the number of FAQs in the current category, if set
324
  *
@@ -506,6 +516,8 @@ class ewdufaqViewFAQs extends ewdufaqView {
506
  public function enqueue_assets() {
507
  global $ewd_ufaq_controller, $wp_scripts;
508
 
 
 
509
  wp_enqueue_style( 'ewd-ufaq-css' );
510
 
511
  $args = array(
319
  return ! empty( $this->current_category ) ? $this->current_category->name : '';
320
  }
321
 
322
+ /**
323
+ * Get the slug of the current category, if set
324
+ *
325
+ * @since 2.0.0
326
+ */
327
+ public function get_category_slug() {
328
+
329
+ return ! empty( $this->current_category ) ? $this->current_category->slug : '';
330
+ }
331
+
332
  /**
333
  * Get the number of FAQs in the current category, if set
334
  *
516
  public function enqueue_assets() {
517
  global $ewd_ufaq_controller, $wp_scripts;
518
 
519
+ wp_enqueue_style( 'ewd-ufaq-rrssb' );
520
+ wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
521
  wp_enqueue_style( 'ewd-ufaq-css' );
522
 
523
  $args = array(
views/View.SubmitFAQ.class.php CHANGED
@@ -332,6 +332,8 @@ class ewdufaqViewSubmitFAQ extends ewdufaqView {
332
  */
333
  public function enqueue_assets() {
334
 
 
 
335
  wp_enqueue_style( 'ewd-ufaq-css' );
336
  }
337
  }
332
  */
333
  public function enqueue_assets() {
334
 
335
+ wp_enqueue_style( 'ewd-ufaq-rrssb' );
336
+ wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
337
  wp_enqueue_style( 'ewd-ufaq-css' );
338
  }
339
  }