Ultimate FAQ - Version 2.0.12

Version Description

(2021-04-22) = - Added workaround for missing formatting when using Elementor due to the way they filter the content. - Removed "Expand All" button from single FAQs. - Fixed a display issue, where "Expand All" was displaying instead of "Collapse All" when display_all_faqs was being used. - Eliminated a notice.

Download this release

Release Info

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

Code changes from version 2.0.11 to 2.0.12

ewd-ufaq-templates/faqs-expand-collapse-all.php CHANGED
@@ -1,11 +1,11 @@
1
  <div class='ewd-ufaq-expand-collapse-div'>
2
 
3
- <span class='ewd-ufaq-expand-all'>
4
  <span class='ewd-ufaq-toggle-all-symbol'>c</span>
5
  <?php echo esc_html( $this->get_label( 'label-expand-all' ) ); ?>
6
  </span>
7
 
8
- <span class='ewd-ufaq-collapse-all ewd-ufaq-hidden'>
9
  <span class='ewd-ufaq-toggle-all-symbol'>C</span>
10
  <?php echo esc_html( $this->get_label( 'label-collapse-all' ) ); ?>
11
  </span>
1
  <div class='ewd-ufaq-expand-collapse-div'>
2
 
3
+ <span class='ewd-ufaq-expand-all <?php echo ( $this->display_all_answers ? 'ewd-ufaq-hidden' : '' ); ?>'>
4
  <span class='ewd-ufaq-toggle-all-symbol'>c</span>
5
  <?php echo esc_html( $this->get_label( 'label-expand-all' ) ); ?>
6
  </span>
7
 
8
+ <span class='ewd-ufaq-collapse-all <?php echo ( ! $this->display_all_answers ? 'ewd-ufaq-hidden' : '' ); ?>'>
9
  <span class='ewd-ufaq-toggle-all-symbol'>C</span>
10
  <?php echo esc_html( $this->get_label( 'label-collapse-all' ) ); ?>
11
  </span>
readme.txt CHANGED
@@ -264,6 +264,12 @@ Video 3 - FAQs Ordering
264
 
265
  == Changelog ==
266
 
 
 
 
 
 
 
267
  = 2.0.11 (2021-04-20) =
268
  - Fixed incorrect URL for category links in FAQ search result
269
  - Fixed link type custom fields not abiding the Hide Blank setting
264
 
265
  == Changelog ==
266
 
267
+ = 2.0.12 (2021-04-22) =
268
+ - Added workaround for missing formatting when using Elementor due to the way they filter the content.
269
+ - Removed "Expand All" button from single FAQs.
270
+ - Fixed a display issue, where "Expand All" was displaying instead of "Collapse All" when display_all_faqs was being used.
271
+ - Eliminated a notice.
272
+
273
  = 2.0.11 (2021-04-20) =
274
  - Fixed incorrect URL for category links in FAQ search result
275
  - Fixed link type custom fields not abiding the Hide Blank setting
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.11
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) )
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.12
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) )
views/View.FAQ.class.php CHANGED
@@ -666,12 +666,12 @@ class ewdufaqViewFAQ extends ewdufaqView {
666
  $this->categories = is_array ( $this->categories ) ? $this->categories : array();
667
  $this->tags = get_the_terms( $this->post->ID, EWD_UFAQ_FAQ_TAG_TAXONOMY );
668
  $this->tags = is_array ( $this->tags ) ? $this->tags : array();
669
-
670
- $this->permalink = $this->build_permalink();
671
 
672
  $this->no_comments = ! empty( $this->no_comments ) ? $this->no_comments : ! $ewd_ufaq_controller->settings->get_setting( 'comments-on' );
673
  $this->display_all_answers = ! empty( $this->display_all_answers ) ? $this->display_all_answers : $ewd_ufaq_controller->settings->get_setting( 'display-all-answers' );
674
 
 
 
675
  if ( ! empty( $this->single_post ) ) { $this->display_all_answers = true; }
676
  }
677
 
@@ -680,6 +680,10 @@ class ewdufaqViewFAQ extends ewdufaqView {
680
  * @since 2.0.0
681
  */
682
  public function set_display_variables() {
 
 
 
 
683
 
684
  add_filter( 'siteorigin_panels_filter_content_enabled', array( $this, 'disable_site_origin_page_builder' ) );
685
 
@@ -691,13 +695,15 @@ class ewdufaqViewFAQ extends ewdufaqView {
691
  $this->date = get_the_date( '', $this->post->ID );
692
 
693
  remove_filter( 'siteorigin_panels_filter_content_enabled', array( $this, 'disable_site_origin_page_builder' ) );
 
 
694
  }
695
 
696
  /**
697
  * Builds the display permalink for the current FAQ, based on selected settings
698
  * @since 2.0.0
699
  */
700
- public function build_permalink() {
701
  global $ewd_ufaq_controller;
702
 
703
  if ( $ewd_ufaq_controller->settings->get_setting( 'permalink-type' ) == 'individual_page' ) {
@@ -710,7 +716,7 @@ class ewdufaqViewFAQ extends ewdufaqView {
710
  return get_permalink() . 'single-faq/' . $this->post->post_name . '/';
711
  }
712
 
713
- return add_query_arg( 'Display_FAQ', $this->post->ID, $this->current_url );
714
  }
715
 
716
  /**
666
  $this->categories = is_array ( $this->categories ) ? $this->categories : array();
667
  $this->tags = get_the_terms( $this->post->ID, EWD_UFAQ_FAQ_TAG_TAXONOMY );
668
  $this->tags = is_array ( $this->tags ) ? $this->tags : array();
 
 
669
 
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; }
676
  }
677
 
680
  * @since 2.0.0
681
  */
682
  public function set_display_variables() {
683
+ global $post;
684
+
685
+ // Added in to get another f$*!ing page builder to work correctly
686
+ $post = get_post( $this->post->ID );
687
 
688
  add_filter( 'siteorigin_panels_filter_content_enabled', array( $this, 'disable_site_origin_page_builder' ) );
689
 
695
  $this->date = get_the_date( '', $this->post->ID );
696
 
697
  remove_filter( 'siteorigin_panels_filter_content_enabled', array( $this, 'disable_site_origin_page_builder' ) );
698
+
699
+ wp_reset_postdata();
700
  }
701
 
702
  /**
703
  * Builds the display permalink for the current FAQ, based on selected settings
704
  * @since 2.0.0
705
  */
706
+ public function add_faq_permalink() {
707
  global $ewd_ufaq_controller;
708
 
709
  if ( $ewd_ufaq_controller->settings->get_setting( 'permalink-type' ) == 'individual_page' ) {
716
  return get_permalink() . 'single-faq/' . $this->post->post_name . '/';
717
  }
718
 
719
+ $this->permalink = add_query_arg( 'Display_FAQ', $this->post->ID, ( ! empty( $this->current_url ) ? $this->current_url : get_permalink() ) );
720
  }
721
 
722
  /**
views/View.FAQs.class.php CHANGED
@@ -106,6 +106,8 @@ class ewdufaqViewFAQs extends ewdufaqView {
106
  global $ewd_ufaq_controller;
107
 
108
  if ( ! $ewd_ufaq_controller->settings->get_setting( 'expand-collapse-all' ) ) { return; }
 
 
109
 
110
  $template = $this->find_template( 'faqs-expand-collapse-all' );
111
 
@@ -375,6 +377,8 @@ class ewdufaqViewFAQs extends ewdufaqView {
375
  $faq->display_all_answers = $this->display_all_answers;
376
  $faq->no_comments = $this->no_comments;
377
  $faq->current_url = $this->current_url;
 
 
378
  }
379
  }
380
 
106
  global $ewd_ufaq_controller;
107
 
108
  if ( ! $ewd_ufaq_controller->settings->get_setting( 'expand-collapse-all' ) ) { return; }
109
+
110
+ if ( sizeOf( $this->faqs ) == 1 ) { return; }
111
 
112
  $template = $this->find_template( 'faqs-expand-collapse-all' );
113
 
377
  $faq->display_all_answers = $this->display_all_answers;
378
  $faq->no_comments = $this->no_comments;
379
  $faq->current_url = $this->current_url;
380
+
381
+ $faq->add_faq_permalink();
382
  }
383
  }
384