Ultimate FAQ - Version 2.0.1

Version Description

(2021-04-07) - Please double check after updating to see if the plugin was automatically re-activated. If not, you just need to manually click the Activate button. - Fixed an issue causing the "Share" label to show when it shouldn't - Fixed an issue causing new FAQs to not display in the order table - Fixed an issue causing the order set in the order table to not apply on the front end - Changed default slug base back to the correct "ufaqs" - Removed the border that was now appearing by default around the toggle symbol

Download this release

Release Info

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

Code changes from version 2.0.0 to 2.0.1

assets/css/ewd-ufaq.css CHANGED
@@ -87,6 +87,7 @@ div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin-symbol{
87
  padding: 2px 0px 0px 2px;
88
  line-height: 1;
89
  border-style: solid;
 
90
  }
91
  .ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol span{
92
  display: inline-block;
87
  padding: 2px 0px 0px 2px;
88
  line-height: 1;
89
  border-style: solid;
90
+ border-width: 0;
91
  }
92
  .ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol span{
93
  display: inline-block;
includes/CustomPostTypes.class.php CHANGED
@@ -354,6 +354,8 @@ class ewdufaqCustomPostTypes {
354
  return $post_id;
355
  }
356
 
 
 
357
  if ( isset( $_POST['faq_author'] ) ) { update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', sanitize_text_field( $_POST['faq_author'] ) ); }
358
  if ( isset( $_POST['up_votes'] ) ) { update_post_meta( $post_id, 'FAQ_Up_Votes', sanitize_text_field( $_POST['up_votes'] ) ); }
359
  if ( isset( $_POST['down_votes'] ) ) { update_post_meta( $post_id, 'FAQ_Down_Votes', sanitize_text_field( $_POST['down_votes'] ) ); }
354
  return $post_id;
355
  }
356
 
357
+ if ( ! get_post_meta( $post_id, 'ufaq_order', true ) ) { update_post_meta( $post_id, 'ufaq_order', 9999 ); }
358
+
359
  if ( isset( $_POST['faq_author'] ) ) { update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', sanitize_text_field( $_POST['faq_author'] ) ); }
360
  if ( isset( $_POST['up_votes'] ) ) { update_post_meta( $post_id, 'FAQ_Up_Votes', sanitize_text_field( $_POST['up_votes'] ) ); }
361
  if ( isset( $_POST['down_votes'] ) ) { update_post_meta( $post_id, 'FAQ_Down_Votes', sanitize_text_field( $_POST['down_votes'] ) ); }
includes/Export.class.php CHANGED
@@ -114,7 +114,10 @@ class ewdufaqExport {
114
  $column = 'G';
115
  foreach ( $faq_fields as $faq_field ) {
116
 
117
- $spreadsheet->getActiveSheet()->setCellValue( $column . $row_count, get_post_meta( $faq->ID, "Custom_Field_" . $faq_field->id, true ) );
 
 
 
118
  $column++;
119
  }
120
 
114
  $column = 'G';
115
  foreach ( $faq_fields as $faq_field ) {
116
 
117
+ $field_value = get_post_meta( $faq->ID, "Custom_Field_" . $faq_field->id, true );
118
+ $field_value = is_array( $field_value ) ? implode( ',', $field_value ) : $field_value;
119
+
120
+ $spreadsheet->getActiveSheet()->setCellValue( $column . $row_count, $field_value );
121
  $column++;
122
  }
123
 
includes/OrderingTable.class.php CHANGED
@@ -42,7 +42,17 @@ class ewdufaqOrderingTable {
42
  $args = array(
43
  'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
44
  'posts_per_page' => -1,
45
- 'meta_key' => 'ufaq_order',
 
 
 
 
 
 
 
 
 
 
46
  'orderby' => 'meta_value_num',
47
  'order' => 'ASC'
48
  );
42
  $args = array(
43
  'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
44
  'posts_per_page' => -1,
45
+ 'meta_query' => array(
46
+ 'relation' => 'OR',
47
+ array(
48
+ 'key' => 'ufaq_order',
49
+ 'compare' => 'EXISTS'
50
+ ),
51
+ array(
52
+ 'key' => 'ufaq_order',
53
+ 'compare' => 'NOT EXISTS'
54
+ )
55
+ ),
56
  'orderby' => 'meta_value_num',
57
  'order' => 'ASC'
58
  );
includes/Query.class.php CHANGED
@@ -194,12 +194,14 @@ class ewdufaqQuery {
194
 
195
  if ( $args['orderby'] == 'rating' or $args['orderby'] == 'popular' ) { $orderby['meta_value_num'] = $args['order']; }
196
  elseif ( $args['orderby'] == 'date' ) { $orderby['date'] = $args['order']; }
197
- elseif ( $orderby == 'title' ) { $orderby['title'] = $args['order']; }
 
198
  }
199
 
200
  if ( $args['orderby'] == 'rating' ) { $args['meta_key'] = 'FAQ_Total_Score'; }
201
  elseif ( $args['orderby'] == 'popular' ) { $args['meta_key'] = 'ufaq_view_count'; }
202
-
 
203
  if ( ! empty( $orderby ) ) { $args['orderby'] = $orderby; }
204
 
205
  $this->args = $args;
194
 
195
  if ( $args['orderby'] == 'rating' or $args['orderby'] == 'popular' ) { $orderby['meta_value_num'] = $args['order']; }
196
  elseif ( $args['orderby'] == 'date' ) { $orderby['date'] = $args['order']; }
197
+ elseif ( $args['orderby'] == 'title' ) { $orderby['title'] = $args['order']; }
198
+ elseif ( $args['orderby'] == 'set_order' ) { $orderby['meta_value_num'] = $args['order']; }
199
  }
200
 
201
  if ( $args['orderby'] == 'rating' ) { $args['meta_key'] = 'FAQ_Total_Score'; }
202
  elseif ( $args['orderby'] == 'popular' ) { $args['meta_key'] = 'ufaq_view_count'; }
203
+ elseif ( $args['orderby'] == 'set_order' ) { $args['meta_key'] = 'ufaq_order'; }
204
+
205
  if ( ! empty( $orderby ) ) { $args['orderby'] = $orderby; }
206
 
207
  $this->args = $args;
includes/Settings.class.php CHANGED
@@ -40,6 +40,7 @@ class ewdufaqSettings {
40
  'access-role' => 'manage_options',
41
 
42
  'display-style' => 'default',
 
43
  'number-of-columns' => 'one',
44
  'faqs-per-page' => 100000,
45
  'page-type' => 'distinct',
40
  'access-role' => 'manage_options',
41
 
42
  'display-style' => 'default',
43
+ 'slug-base' => 'ufaqs',
44
  'number-of-columns' => 'one',
45
  'faqs-per-page' => 100000,
46
  'page-type' => 'distinct',
readme.txt CHANGED
@@ -149,7 +149,6 @@ For help and support, please see:
149
  ](https://www.youtube.com/playlist?list=PLEndQUuhlvSrNdfu5FKa1uGHsaKZxgdWt)
150
  * The Ultimate FAQ support forum, here: [https://wordpress.org/support/plugin/ultimate-faqs](https://wordpress.org/support/plugin/ultimate-faqs)
151
 
152
-
153
  == Frequently Asked Questions ==
154
 
155
  = How do I get my FAQs to show up on my page? =
@@ -265,8 +264,17 @@ Video 3 - FAQs Ordering
265
 
266
  == Changelog ==
267
 
 
 
 
 
 
 
 
 
268
  = 2.0.0 (2021-04-06)
269
  - <strong>This update includes quite a big change to the construction of the plugin, so please take caution and test before updating on a live site (or wait a few days before updating in case some minor corrective updates need to be released).</strong>
 
270
  - Rebuilt the plugin, from the ground up, to be object oriented.
271
  - Updated the structure of the settings pages.
272
  - Fixed an issue with the WooCommerce integration causing other tabs to not display.
149
  ](https://www.youtube.com/playlist?list=PLEndQUuhlvSrNdfu5FKa1uGHsaKZxgdWt)
150
  * The Ultimate FAQ support forum, here: [https://wordpress.org/support/plugin/ultimate-faqs](https://wordpress.org/support/plugin/ultimate-faqs)
151
 
 
152
  == Frequently Asked Questions ==
153
 
154
  = How do I get my FAQs to show up on my page? =
264
 
265
  == Changelog ==
266
 
267
+ = 2.0.1 (2021-04-07)
268
+ - <strong>Please double check after updating to see if the plugin was automatically re-activated. If not, you just need to manually click the Activate button.</strong>
269
+ - Fixed an issue causing the "Share" label to show when it shouldn't
270
+ - Fixed an issue causing new FAQs to not display in the order table
271
+ - Fixed an issue causing the order set in the order table to not apply on the front end
272
+ - Changed default slug base back to the correct "ufaqs"
273
+ - Removed the border that was now appearing by default around the toggle symbol
274
+
275
  = 2.0.0 (2021-04-06)
276
  - <strong>This update includes quite a big change to the construction of the plugin, so please take caution and test before updating on a live site (or wait a few days before updating in case some minor corrective updates need to be released).</strong>
277
+ - <strong>Please also double check after updating to see if the plugin was automatically re-activated. If not, you just need to manually click the Activate button.</strong>
278
  - Rebuilt the plugin, from the ground up, to be object oriented.
279
  - Updated the structure of the settings pages.
280
  - Fixed an issue with the WooCommerce integration causing other tabs to not display.
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.0
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.1
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) )
views/View.FAQ.class.php CHANGED
@@ -257,12 +257,19 @@ class ewdufaqViewFAQ extends ewdufaqView {
257
  /**
258
  * Print the social media links, if enabled
259
  *
 
 
 
260
  * @since 2.0.0
261
  */
262
  public function maybe_print_social_media() {
263
  global $ewd_ufaq_controller;
264
 
265
  if ( empty( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
 
 
 
 
266
 
267
  $template = $this->find_template( 'faq-social-media' );
268
 
257
  /**
258
  * Print the social media links, if enabled
259
  *
260
+ * Extra checks included to make sure that this section doesn't
261
+ * display with an array that has only a blank element
262
+ *
263
  * @since 2.0.0
264
  */
265
  public function maybe_print_social_media() {
266
  global $ewd_ufaq_controller;
267
 
268
  if ( empty( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
269
+
270
+ if ( ! is_array( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
271
+
272
+ if ( sizeof( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) == 1 and in_array( '', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
273
 
274
  $template = $this->find_template( 'faq-social-media' );
275