Ultimate FAQ - Version 1.6.16

Version Description

  • Added in an option to have the category toggles accordion
Download this release

Release Info

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

Code changes from version 1.6.15 to 1.6.16

Functions/Update_Admin_Databases.php CHANGED
@@ -27,6 +27,7 @@ function EWD_UFAQ_UpdateOptions() {
27
  if (isset($_POST['Options_Submit'])) {update_option('EWD_UFAQ_Custom_CSS', $Custom_CSS);}
28
  if (isset($_POST['faq_toggle'])) {update_option('EWD_UFAQ_Toggle', sanitize_text_field($_POST['faq_toggle']));}
29
  if (isset($_POST['faq_category_toggle'])) {update_option('EWD_UFAQ_Category_Toggle', sanitize_text_field($_POST['faq_category_toggle']));}
 
30
  if (isset($_POST['expand_collapse_all'])) {update_option('EWD_UFAQ_Expand_Collapse_All', sanitize_text_field($_POST['expand_collapse_all']));}
31
  if (isset($_POST['faq_accordion'])) {update_option('EWD_UFAQ_FAQ_Accordion', sanitize_text_field($_POST['faq_accordion']));}
32
  if (isset($_POST['faq_auto_complete_titles'])) {update_option('EWD_UFAQ_Auto_Complete_Titles', sanitize_text_field($_POST['faq_auto_complete_titles']));}
27
  if (isset($_POST['Options_Submit'])) {update_option('EWD_UFAQ_Custom_CSS', $Custom_CSS);}
28
  if (isset($_POST['faq_toggle'])) {update_option('EWD_UFAQ_Toggle', sanitize_text_field($_POST['faq_toggle']));}
29
  if (isset($_POST['faq_category_toggle'])) {update_option('EWD_UFAQ_Category_Toggle', sanitize_text_field($_POST['faq_category_toggle']));}
30
+ if (isset($_POST['faq_category_accordion'])) {update_option('EWD_UFAQ_Category_Accordion', sanitize_text_field($_POST['faq_category_accordion']));}
31
  if (isset($_POST['expand_collapse_all'])) {update_option('EWD_UFAQ_Expand_Collapse_All', sanitize_text_field($_POST['expand_collapse_all']));}
32
  if (isset($_POST['faq_accordion'])) {update_option('EWD_UFAQ_FAQ_Accordion', sanitize_text_field($_POST['faq_accordion']));}
33
  if (isset($_POST['faq_auto_complete_titles'])) {update_option('EWD_UFAQ_Auto_Complete_Titles', sanitize_text_field($_POST['faq_auto_complete_titles']));}
Main.php CHANGED
@@ -7,14 +7,14 @@ Author: Etoile Web Design
7
  Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: ultimate-faqs
10
- Version: 1.6.15
11
  */
12
 
13
  global $ewd_ufaq_message;
14
  global $UFAQ_Full_Version;
15
  global $EWD_UFAQ_Version;
16
 
17
- $EWD_UFAQ_Version = '1.6.14';
18
  if (get_option("EWD_UFAQ_Version") == "") {update_option("EWD_UFAQ_Version", $EWD_UFAQ_Version);}
19
 
20
  define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
@@ -172,6 +172,7 @@ function save_ufaq_error(){
172
  function Set_EWD_UFAQ_Options() {
173
  if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
174
  if (get_option("EWD_UFAQ_Category_Toggle") == "") {update_option("EWD_UFAQ_Category_Toggle", "No");}
 
175
  if (get_option("EWD_UFAQ_Expand_Collapse_All") == "") {update_option("EWD_UFAQ_Expand_Collapse_All", "No");}
176
  if (get_option("EWD_UFAQ_FAQ_Accordion") == "") {update_option("EWD_UFAQ_FAQ_Accordion", "No");}
177
  if (get_option("EWD_UFAQ_Hide_Categories") == "") {update_option("EWD_UFAQ_Hide_Categories", "No");}
7
  Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: ultimate-faqs
10
+ Version: 1.6.16
11
  */
12
 
13
  global $ewd_ufaq_message;
14
  global $UFAQ_Full_Version;
15
  global $EWD_UFAQ_Version;
16
 
17
+ $EWD_UFAQ_Version = '1.6.16';
18
  if (get_option("EWD_UFAQ_Version") == "") {update_option("EWD_UFAQ_Version", $EWD_UFAQ_Version);}
19
 
20
  define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
172
  function Set_EWD_UFAQ_Options() {
173
  if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
174
  if (get_option("EWD_UFAQ_Category_Toggle") == "") {update_option("EWD_UFAQ_Category_Toggle", "No");}
175
+ if (get_option("EWD_UFAQ_Category_Accordion") == "") {update_option("EWD_UFAQ_Category_Accordion", "No");}
176
  if (get_option("EWD_UFAQ_Expand_Collapse_All") == "") {update_option("EWD_UFAQ_Expand_Collapse_All", "No");}
177
  if (get_option("EWD_UFAQ_FAQ_Accordion") == "") {update_option("EWD_UFAQ_FAQ_Accordion", "No");}
178
  if (get_option("EWD_UFAQ_Hide_Categories") == "") {update_option("EWD_UFAQ_Hide_Categories", "No");}
Shortcodes/DisplayFAQs.php CHANGED
@@ -5,6 +5,7 @@ function Display_FAQs($atts) {
5
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
6
  $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
7
  $Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
 
8
  $Expand_Collapse_All = get_option("EWD_UFAQ_Expand_Collapse_All");
9
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
10
  $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
@@ -263,9 +264,7 @@ function Display_FAQs($atts) {
263
 
264
  if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and $Category != 'uncategorized' and $FAQ_Query->post_count > 0) {
265
  $ReturnString .= "<div class='ufaq-faq-category'>";
266
- $ReturnString .= "<div class='ufaq-faq-category-title";
267
- if ($Category_Toggle == "Yes") {$ReturnString .= " ufaq-faq-category-title-toggle";}
268
- $ReturnString .= "' data-categoryid='" . $Category->term_id . "'>";
269
  $ReturnString .= "<" . $UFAQ_Styling_Category_Heading_Type . ">" . $Category->name . ($Group_By_Category_Count == "Yes" ? " <span>(" . $FAQ_Query->post_count . ")" : "") . "</span></" . $UFAQ_Styling_Category_Heading_Type . ">";
270
  $ReturnString .= "</div>";
271
  $ReturnString .= "<div class='ufaq-faq-category-inner";
5
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
6
  $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
7
  $Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
8
+ $Category_Accordion = get_option("EWD_UFAQ_Category_Accordion");
9
  $Expand_Collapse_All = get_option("EWD_UFAQ_Expand_Collapse_All");
10
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
11
  $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
264
 
265
  if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and $Category != 'uncategorized' and $FAQ_Query->post_count > 0) {
266
  $ReturnString .= "<div class='ufaq-faq-category'>";
267
+ $ReturnString .= "<div class='ufaq-faq-category-title" . ($Category_Toggle == "Yes" ? " ufaq-faq-category-title-toggle" : "") . ($Category_Accordion == "Yes" ? " ufaq-faq-category-title-accordion" : "") . "' data-categoryid='" . $Category->term_id . "'>";
 
 
268
  $ReturnString .= "<" . $UFAQ_Styling_Category_Heading_Type . ">" . $Category->name . ($Group_By_Category_Count == "Yes" ? " <span>(" . $FAQ_Query->post_count . ")" : "") . "</span></" . $UFAQ_Styling_Category_Heading_Type . ">";
269
  $ReturnString .= "</div>";
270
  $ReturnString .= "<div class='ufaq-faq-category-inner";
html/OptionsPage.php CHANGED
@@ -2,6 +2,7 @@
2
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
3
  $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
4
  $FAQ_Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
 
5
  $Expand_Collapse_All = get_option("EWD_UFAQ_Expand_Collapse_All");
6
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
7
  $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
@@ -230,6 +231,16 @@
230
  </td>
231
  </tr>
232
  <tr>
 
 
 
 
 
 
 
 
 
 
233
  <th scope="row">FAQ Expand/Collapse All</th>
234
  <td>
235
  <fieldset><legend class="screen-reader-text"><span>FAQ Expand/Collapse All</span></legend>
2
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
3
  $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
4
  $FAQ_Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
5
+ $FAQ_Category_Accordion = get_option("EWD_UFAQ_Category_Accordion");
6
  $Expand_Collapse_All = get_option("EWD_UFAQ_Expand_Collapse_All");
7
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
8
  $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
231
  </td>
232
  </tr>
233
  <tr>
234
+ <th scope="row">FAQ Category Accordion</th>
235
+ <td>
236
+ <fieldset><legend class="screen-reader-text"><span>FAQ Category Accordion</span></legend>
237
+ <label title='Yes'><input type='radio' name='faq_category_accordion' value='Yes' <?php if($FAQ_Category_Accordion == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
238
+ <label title='No'><input type='radio' name='faq_category_accordion' value='No' <?php if($FAQ_Category_Accordion == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
239
+ <p>Should it only be possible to open one FAQ category at a time, if FAQ categories are being toggled ("FAQ Category Toggle" must be set to "Yes" above)? </p>
240
+ </fieldset>
241
+ </td>
242
+ </tr>
243
+ <tr>
244
  <th scope="row">FAQ Expand/Collapse All</th>
245
  <td>
246
  <fieldset><legend class="screen-reader-text"><span>FAQ Expand/Collapse All</span></legend>
js/ewd-ufaq-js.js CHANGED
@@ -42,8 +42,13 @@ function ufaqSetClickHandlers() {
42
 
43
  jQuery('.ufaq-faq-category-title-toggle').off('click').on('click', function(event) {
44
  var category_id = jQuery(this).attr("data-categoryid");
 
 
 
 
 
45
 
46
- if (jQuery('#ufaq-faq-category-body-'+category_id).hasClass("ufaq-faq-category-body-hidden")) {
47
  jQuery('#ufaq-faq-category-body-'+category_id).removeClass("ufaq-faq-category-body-hidden");
48
  }
49
  else {
42
 
43
  jQuery('.ufaq-faq-category-title-toggle').off('click').on('click', function(event) {
44
  var category_id = jQuery(this).attr("data-categoryid");
45
+ var closed = jQuery('#ufaq-faq-category-body-'+category_id).hasClass("ufaq-faq-category-body-hidden");
46
+
47
+ if (jQuery(this).hasClass('ufaq-faq-category-title-accordion')) {
48
+ jQuery('.ufaq-faq-category-inner').addClass("ufaq-faq-category-body-hidden");
49
+ }
50
 
51
+ if (closed) {
52
  jQuery('#ufaq-faq-category-body-'+category_id).removeClass("ufaq-faq-category-body-hidden");
53
  }
54
  else {
readme.txt CHANGED
@@ -266,8 +266,11 @@ Video 3 - FAQs Ordering
266
 
267
 
268
  == Changelog ==
 
 
 
269
  = 1.6.15 =
270
- - Added in a option to let users submit custom fields along with their questions when using the submit question shortcode
271
 
272
  = 1.6.14 =
273
  - Fixed a deprecated function issue for PHP 7.2 users
266
 
267
 
268
  == Changelog ==
269
+ = 1.6.16 =
270
+ - Added in an option to have the category toggles accordion
271
+
272
  = 1.6.15 =
273
+ - Added in an option to let users submit custom fields along with their questions when using the submit question shortcode
274
 
275
  = 1.6.14 =
276
  - Fixed a deprecated function issue for PHP 7.2 users