Ultimate FAQ - Version 1.1.6

Version Description

  • Removed blank categories from FAQ search results
  • Added in a "Permalink Type" option, which lets you decide between linking to the post in the main page and the individual post page
Download this release

Release Info

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

Code changes from version 1.1.5 to 1.1.6

Functions/EWD_UFAQ_Version_Update.php CHANGED
@@ -22,6 +22,7 @@ function EWD_UFAQ_Version_Update() {
22
  if (get_option("EWD_UFAQ_Display_Style") == "") {update_option("EWD_UFAQ_Display_Style", "Default");}
23
  if (get_option("EWD_UFAQ_Color_Block_Shape") == "") {update_option("EWD_UFAQ_Color_Block_Shape", "Square");}
24
  if (get_option("FAQ_Auto_Complete_Titles") == "") {update_option("FAQ_Auto_Complete_Titles", "Yes");}
 
25
 
26
  update_option('EWD_UFAQ_Version', $EWD_UFAQ_Version);
27
  }
22
  if (get_option("EWD_UFAQ_Display_Style") == "") {update_option("EWD_UFAQ_Display_Style", "Default");}
23
  if (get_option("EWD_UFAQ_Color_Block_Shape") == "") {update_option("EWD_UFAQ_Color_Block_Shape", "Square");}
24
  if (get_option("FAQ_Auto_Complete_Titles") == "") {update_option("FAQ_Auto_Complete_Titles", "Yes");}
25
+ if (get_option("EWD_UFAQ_Permalink_Type") == "") {update_option("EWD_UFAQ_Permalink_Type", "SamePage");}
26
 
27
  update_option('EWD_UFAQ_Version', $EWD_UFAQ_Version);
28
  }
Functions/Update_Admin_Databases.php CHANGED
@@ -55,6 +55,8 @@ function EWD_UFAQ_UpdateOptions() {
55
  if (isset($_POST['order_by_setting'])) {update_option('EWD_UFAQ_Order_By', $Order_By_Setting);}
56
  if (isset($_POST['order_setting'])) {update_option('EWD_UFAQ_Order', $Order_Setting);}
57
  if (isset($_POST['include_permalink'])) {update_option('EWD_UFAQ_Include_Permalink', $Include_Permalink);}
 
 
58
  if (isset($_POST['pretty_permalinks'])) {update_option('EWD_UFAQ_Pretty_Permalinks', $Pretty_Permalinks);}
59
  if (isset($_POST['display_all_answers'])) {update_option('EWD_UFAQ_Display_All_Answers', $Display_All_Answers);}
60
  if (isset($_POST['scroll_to_top'])) {update_option('EWD_UFAQ_Scroll_To_Top', $Scroll_To_Top);}
55
  if (isset($_POST['order_by_setting'])) {update_option('EWD_UFAQ_Order_By', $Order_By_Setting);}
56
  if (isset($_POST['order_setting'])) {update_option('EWD_UFAQ_Order', $Order_Setting);}
57
  if (isset($_POST['include_permalink'])) {update_option('EWD_UFAQ_Include_Permalink', $Include_Permalink);}
58
+ if (isset($_POST['permalink_type'])) {update_option('EWD_UFAQ_Permalink_Type', $_POST['permalink_type']);}
59
+
60
  if (isset($_POST['pretty_permalinks'])) {update_option('EWD_UFAQ_Pretty_Permalinks', $Pretty_Permalinks);}
61
  if (isset($_POST['display_all_answers'])) {update_option('EWD_UFAQ_Display_All_Answers', $Display_All_Answers);}
62
  if (isset($_POST['scroll_to_top'])) {update_option('EWD_UFAQ_Scroll_To_Top', $Scroll_To_Top);}
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: EWD_UFAQ
10
- Version: 1.1.5
11
  */
12
 
13
  global $ewd_ufaq_message;
14
  global $UFAQ_Full_Version;
15
  global $EWD_UFAQ_Version;
16
 
17
- $EWD_UFAQ_Version = '1.1.0';
18
 
19
  define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
  define( 'EWD_UFAQ_CD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
@@ -123,6 +123,7 @@ function Set_EWD_UFAQ_Options() {
123
  if (get_option("EWD_UFAQ_Group_By_Order") == "") {update_option("EWD_UFAQ_Group_By_Order", "ASC");}
124
  if (get_option("EWD_UFAQ_Order_By") == "") {update_option("EWD_UFAQ_Order_By", "date");}
125
  if (get_option("EWD_UFAQ_Order") == "") {update_option("EWD_UFAQ_Order", "DESC");}
 
126
 
127
  if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
128
  if (get_option("EWD_UFAQ_Display_Back_To_Top") == "") {update_option("EWD_UFAQ_Display_Back_To_Top", "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: EWD_UFAQ
10
+ Version: 1.1.6
11
  */
12
 
13
  global $ewd_ufaq_message;
14
  global $UFAQ_Full_Version;
15
  global $EWD_UFAQ_Version;
16
 
17
+ $EWD_UFAQ_Version = '1.1.6';
18
 
19
  define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
  define( 'EWD_UFAQ_CD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
123
  if (get_option("EWD_UFAQ_Group_By_Order") == "") {update_option("EWD_UFAQ_Group_By_Order", "ASC");}
124
  if (get_option("EWD_UFAQ_Order_By") == "") {update_option("EWD_UFAQ_Order_By", "date");}
125
  if (get_option("EWD_UFAQ_Order") == "") {update_option("EWD_UFAQ_Order", "DESC");}
126
+ if (get_option("EWD_UFAQ_Permalink_Type") == "") {update_option("EWD_UFAQ_Permalink_Type", "SamePage");}
127
 
128
  if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
129
  if (get_option("EWD_UFAQ_Display_Back_To_Top") == "") {update_option("EWD_UFAQ_Display_Back_To_Top", "No");}
Shortcodes/DisplayFAQs.php CHANGED
@@ -17,6 +17,7 @@ function Display_FAQs($atts) {
17
  $Order_By_Setting = get_option("EWD_UFAQ_Order_By");
18
  $Order_Setting = get_option("EWD_UFAQ_Order");
19
  $Include_Permalink = get_option("EWD_UFAQ_Include_Permalink");
 
20
  $Display_Style = get_option("EWD_UFAQ_Display_Style");
21
  $Color_Block_Shape = get_option("EWD_UFAQ_Color_Block_Shape");
22
  $Pretty_Permalinks = get_option("EWD_UFAQ_Pretty_Permalinks");
@@ -160,6 +161,7 @@ function Display_FAQs($atts) {
160
  $category_array
161
  )
162
  );
 
163
  if ($orig_order_setting == "popular") {$params['meta_key'] = 'ufaq_view_count';}
164
  if ($orig_order_setting == "set_order") {$params['meta_key'] = 'ufaq_order';}
165
  $faqs = get_posts($params);
@@ -177,12 +179,16 @@ function Display_FAQs($atts) {
177
  }
178
 
179
  foreach ($faqs as $faq) {
180
- if ($search_string == "" or strpos(strtolower($faq->post_content), $search_string) !== false or strpos(strtolower($faq->post_title), $search_string) !== false) {
181
  $Category_Terms = wp_get_post_terms($faq->ID, 'ufaq-category');
182
  $Tag_Terms = wp_get_post_terms($faq->ID, 'ufaq-tag');
183
 
184
- if ($Pretty_Permalinks == "Yes") {$FAQ_Permalink = get_the_permalink() . "single-faq/" . $faq->post_name;}
185
- else {$FAQ_Permalink = get_the_permalink() . "?Display_FAQ=" . $faq->ID;}
 
 
 
 
 
186
 
187
  if ($Display_FAQ_ID == $faq->ID) {
188
  $ReturnString = str_replace("%Counter_Placeholder%", $Counter, $ReturnString);
@@ -283,7 +289,6 @@ function Display_FAQs($atts) {
283
 
284
  $ReturnString .= "</div>";
285
  $ReturnString .= "</div>";
286
- }
287
 
288
  $Counter++;
289
  }
17
  $Order_By_Setting = get_option("EWD_UFAQ_Order_By");
18
  $Order_Setting = get_option("EWD_UFAQ_Order");
19
  $Include_Permalink = get_option("EWD_UFAQ_Include_Permalink");
20
+ $Permalink_Type = get_option("EWD_UFAQ_Permalink_Type");
21
  $Display_Style = get_option("EWD_UFAQ_Display_Style");
22
  $Color_Block_Shape = get_option("EWD_UFAQ_Color_Block_Shape");
23
  $Pretty_Permalinks = get_option("EWD_UFAQ_Pretty_Permalinks");
161
  $category_array
162
  )
163
  );
164
+ if ($search_string != "") {$params['s'] = $search_string;}
165
  if ($orig_order_setting == "popular") {$params['meta_key'] = 'ufaq_view_count';}
166
  if ($orig_order_setting == "set_order") {$params['meta_key'] = 'ufaq_order';}
167
  $faqs = get_posts($params);
179
  }
180
 
181
  foreach ($faqs as $faq) {
 
182
  $Category_Terms = wp_get_post_terms($faq->ID, 'ufaq-category');
183
  $Tag_Terms = wp_get_post_terms($faq->ID, 'ufaq-tag');
184
 
185
+ if ($Permalink_Type == "IndividualPage") {
186
+ $FAQ_Permalink = get_permalink($faq->ID);
187
+ }
188
+ else {
189
+ if ($Pretty_Permalinks == "Yes") {$FAQ_Permalink = get_the_permalink() . "single-faq/" . $faq->post_name;}
190
+ else {$FAQ_Permalink = get_the_permalink() . "?Display_FAQ=" . $faq->ID;}
191
+ }
192
 
193
  if ($Display_FAQ_ID == $faq->ID) {
194
  $ReturnString = str_replace("%Counter_Placeholder%", $Counter, $ReturnString);
289
 
290
  $ReturnString .= "</div>";
291
  $ReturnString .= "</div>";
 
292
 
293
  $Counter++;
294
  }
html/OptionsPage.php CHANGED
@@ -16,6 +16,7 @@
16
  $Order_By_Setting = get_option("EWD_UFAQ_Order_By");
17
  $Order_Setting = get_option("EWD_UFAQ_Order");
18
  $Include_Permalink = get_option("EWD_UFAQ_Include_Permalink");
 
19
  $Pretty_Permalinks = get_option("EWD_UFAQ_Pretty_Permalinks");
20
  $Display_All_Answers = get_option("EWD_UFAQ_Display_All_Answers");
21
  $Scroll_To_Top = get_option("EWD_UFAQ_Scroll_To_Top");
@@ -195,6 +196,16 @@
195
  </fieldset>
196
  </td>
197
  </tr>
 
 
 
 
 
 
 
 
 
 
198
  </table>
199
  </div>
200
 
@@ -475,7 +486,7 @@
475
 
476
  <div id='ufaq-styling-options' class="ufaq-options-div ufaq-options-flex">
477
  <div class='ufaq-subsection'>
478
- <div class='ufaq-subsection-header'>Default Theme</div>
479
  <div class='ufaq-subsection-content'>
480
  <div class='ufaq-option ufaq-styling-option'>
481
  <div class='ufaq-option-label'>Icon Background Color</div>
16
  $Order_By_Setting = get_option("EWD_UFAQ_Order_By");
17
  $Order_Setting = get_option("EWD_UFAQ_Order");
18
  $Include_Permalink = get_option("EWD_UFAQ_Include_Permalink");
19
+ $Permalink_Type = get_option("EWD_UFAQ_Permalink_Type");
20
  $Pretty_Permalinks = get_option("EWD_UFAQ_Pretty_Permalinks");
21
  $Display_All_Answers = get_option("EWD_UFAQ_Display_All_Answers");
22
  $Scroll_To_Top = get_option("EWD_UFAQ_Scroll_To_Top");
196
  </fieldset>
197
  </td>
198
  </tr>
199
+ <tr>
200
+ <th scope="row">Permalink Type</th>
201
+ <td>
202
+ <fieldset><legend class="screen-reader-text"><span>Include Permalink Icon</span></legend>
203
+ <label title='SamePage'><input type='radio' name='permalink_type' value='SamePage' <?php if($Permalink_Type == "SamePage") {echo "checked='checked'";} ?> /> <span>Same Page</span></label><br />
204
+ <label title='IndividualPage'><input type='radio' name='permalink_type' value='IndividualPage' <?php if($Permalink_Type == "IndividualPage") {echo "checked='checked'";} ?> /> <span>Individual Page</span></label><br />
205
+ <p>Should the permalink icon link to the main FAQ page, or to the individual FAQ post?</p>
206
+ </fieldset>
207
+ </td>
208
+ </tr>
209
  </table>
210
  </div>
211
 
486
 
487
  <div id='ufaq-styling-options' class="ufaq-options-div ufaq-options-flex">
488
  <div class='ufaq-subsection'>
489
+ <div class='ufaq-subsection-header'>Color Block Theme</div>
490
  <div class='ufaq-subsection-content'>
491
  <div class='ufaq-option ufaq-styling-option'>
492
  <div class='ufaq-option-label'>Icon Background Color</div>
readme.txt CHANGED
@@ -126,6 +126,10 @@ For more questions and support you can post in the support forum:
126
  9. All answers displayed in the 'list' FAQ mode
127
 
128
  == Changelog ==
 
 
 
 
129
  = 1.1.5 =
130
  - Fixed a problem with FAQ permalinks not opening in the list
131
 
126
  9. All answers displayed in the 'list' FAQ mode
127
 
128
  == Changelog ==
129
+ = 1.1.6 =
130
+ - Removed blank categories from FAQ search results
131
+ - Added in a "Permalink Type" option, which lets you decide between linking to the post in the main page and the individual post page
132
+
133
  = 1.1.5 =
134
  - Fixed a problem with FAQ permalinks not opening in the list
135