Ultimate FAQ - Version 2.0.17

Version Description

(2021-05-14) = - Fixed an issue causing the AJAX dynamic search results to not automatically show when typing when auto complete was disabled. - Fixed a conflict between multiple shortcodes listed on the search page. Please, you still should not have any extra shortcodes on your search page other than the one search shortcode! - Fixed issue with incorrect tag and category links on single post page.

Download this release

Release Info

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

Code changes from version 2.0.16 to 2.0.17

assets/js/ewd-ufaq.js CHANGED
@@ -177,7 +177,7 @@ jQuery(document).ready(function() {
177
  ewd_ufaq_ajax_reload();
178
  });
179
 
180
- jQuery( '#ewd-ufaq-ajax-text-input' ).keyup( function() {
181
 
182
  ewd_ufaq_ajax_reload();
183
  });
177
  ewd_ufaq_ajax_reload();
178
  });
179
 
180
+ jQuery( '#ewd-ufaq-jquery-ajax-search .ewd-ufaq-text-input' ).keyup( function() {
181
 
182
  ewd_ufaq_ajax_reload();
183
  });
readme.txt CHANGED
@@ -264,6 +264,11 @@ Video 3 - FAQs Ordering
264
 
265
  == Changelog ==
266
 
 
 
 
 
 
267
  = 2.0.16 (2021-05-10) =
268
  - Fixed an issue in which the wrong URL was being generated for tag links when pretty permalink was enabled.
269
  - Added an option to disable front-page canonical redirects if you are using your homepage as your FAQ page.
264
 
265
  == Changelog ==
266
 
267
+ = 2.0.17 (2021-05-14) =
268
+ - Fixed an issue causing the AJAX dynamic search results to not automatically show when typing when auto complete was disabled.
269
+ - Fixed a conflict between multiple shortcodes listed on the search page. Please, you still should not have any extra shortcodes on your search page other than the one search shortcode!
270
+ - Fixed issue with incorrect tag and category links on single post page.
271
+
272
  = 2.0.16 (2021-05-10) =
273
  - Fixed an issue in which the wrong URL was being generated for tag links when pretty permalink was enabled.
274
  - Added an option to disable front-page canonical redirects if you are using your homepage as your FAQ page.
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.16
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) )
@@ -335,8 +335,12 @@ class ewdufaqInit {
335
 
336
  if ( is_archive() ) { return $content; }
337
 
 
 
338
  $content = do_shortcode( '[select-faq faq_id="' . $post->ID . '"]' );
339
 
 
 
340
  return $content;
341
  }
342
 
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.17
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) )
335
 
336
  if ( is_archive() ) { return $content; }
337
 
338
+ $ewd_ufaq_controller->single_page_print = true;
339
+
340
  $content = do_shortcode( '[select-faq faq_id="' . $post->ID . '"]' );
341
 
342
+ $ewd_ufaq_controller->single_page_print = false;
343
+
344
  return $content;
345
  }
346
 
views/View.FAQ.class.php CHANGED
@@ -509,7 +509,7 @@ class ewdufaqViewFAQ extends ewdufaqView {
509
 
510
  $category_url = $ewd_ufaq_controller->settings->get_setting( 'pretty-permalinks' ) ? $this->current_url . 'faq-category/' . urlencode( $category->slug ) . '/' : add_query_arg( 'include_category', urlencode( $category->slug ), $this->current_url );
511
 
512
- return '<a href="' . esc_attr( $category_url ) . '">' . $category->name . '</a>';
513
  }
514
 
515
  /**
@@ -533,7 +533,7 @@ class ewdufaqViewFAQ extends ewdufaqView {
533
 
534
  $tag_url = $ewd_ufaq_controller->settings->get_setting( 'pretty-permalinks' ) ? $this->current_url . 'faq-tag/' . urlencode( $tag->slug ) . '/' : add_query_arg( 'include_tag', urlencode( $tag->slug ), $this->current_url );
535
 
536
- return '<a href="' . esc_attr( $tag_url ) . '">' . $tag->name . '</a>';
537
  }
538
 
539
  /**
509
 
510
  $category_url = $ewd_ufaq_controller->settings->get_setting( 'pretty-permalinks' ) ? $this->current_url . 'faq-category/' . urlencode( $category->slug ) . '/' : add_query_arg( 'include_category', urlencode( $category->slug ), $this->current_url );
511
 
512
+ return empty( $ewd_ufaq_controller->single_page_print ) ? '<a href="' . esc_attr( $category_url ) . '">' . $category->name . '</a>' : $category->name;
513
  }
514
 
515
  /**
533
 
534
  $tag_url = $ewd_ufaq_controller->settings->get_setting( 'pretty-permalinks' ) ? $this->current_url . 'faq-tag/' . urlencode( $tag->slug ) . '/' : add_query_arg( 'include_tag', urlencode( $tag->slug ), $this->current_url );
535
 
536
+ return empty( $ewd_ufaq_controller->single_page_print ) ? '<a href="' . esc_attr( $tag_url ) . '">' . $tag->name . '</a>' : $tag->name;
537
  }
538
 
539
  /**
views/View.FAQs.class.php CHANGED
@@ -189,8 +189,7 @@ class ewdufaqViewFAQs extends ewdufaqView {
189
  public function print_faqs_individually() {
190
 
191
  foreach ( $this->faqs as $faq_count => $faq ) {
192
-
193
- if ( $faq_count < $this->faqs_per_page * ( $this->faq_page - 1) or $faq_count >= $this->faqs_per_page * ( $this->faq_page ) ) { continue; }
194
 
195
  $this->faq_count = $faq_count;
196
 
@@ -503,7 +502,7 @@ class ewdufaqViewFAQs extends ewdufaqView {
503
  * @since 2.0.0
504
  */
505
  public function enqueue_assets() {
506
- global $ewd_ufaq_controller;
507
 
508
  wp_enqueue_style( 'ewd-ufaq-css' );
509
 
@@ -529,7 +528,17 @@ class ewdufaqViewFAQs extends ewdufaqView {
529
  $args['display_faq'] = intval( $_GET['Display_FAQ'] );
530
  }
531
 
532
- wp_localize_script( 'ewd-ufaq-js', 'ewd_ufaq_php_data', $args );
 
 
 
 
 
 
 
 
 
 
533
 
534
  wp_enqueue_script( 'ewd-ufaq-js' );
535
 
189
  public function print_faqs_individually() {
190
 
191
  foreach ( $this->faqs as $faq_count => $faq ) {
192
+ if ( $this->faqs_per_page > 0 && ($faq_count < $this->faqs_per_page * ( $this->faq_page - 1) or $faq_count >= $this->faqs_per_page * ( $this->faq_page ) ) ) { continue; }
 
193
 
194
  $this->faq_count = $faq_count;
195
 
502
  * @since 2.0.0
503
  */
504
  public function enqueue_assets() {
505
+ global $ewd_ufaq_controller, $wp_scripts;
506
 
507
  wp_enqueue_style( 'ewd-ufaq-css' );
508
 
528
  $args['display_faq'] = intval( $_GET['Display_FAQ'] );
529
  }
530
 
531
+ $handle = 'ewd-ufaq-js';
532
+ // Fetch any existing script data
533
+ $prev_question_titles = $wp_scripts->get_data( $handle, 'question_titles' );
534
+
535
+ if ( ! empty( $prev_question_titles ) ) {
536
+ $args['question_titles'] = array_merge( $prev_question_titles, $args['question_titles'] );
537
+ $args['question_titles'] = array_unique( $args['question_titles'] );
538
+ }
539
+
540
+ $wp_scripts->add_data( $handle, 'question_titles', $args['question_titles'] );
541
+ wp_localize_script( $handle, 'ewd_ufaq_php_data', $args );
542
 
543
  wp_enqueue_script( 'ewd-ufaq-js' );
544