Version Description
(2022-08-12) = - Introducing new block patterns, which can be used to integrate FAQs directly into your block-based theme templates. - Added a parameter to the Display FAQs block, as well as an attribute to the ultimate-faqs shortcode, that lets you enable/disable grouping FAQs by category for that specific instance. - Added a Tags column to the main admin FAQs overview/table. - Updated the success/failure/validation messaging for the submit question form and added labelling options for these.
Download this release
Release Info
Developer | Rustaurius |
Plugin | Ultimate FAQ |
Version | 2.1.16 |
Comparing to | |
See all releases |
Code changes from version 2.1.15 to 2.1.16
- assets/css/ewd-ufaq.css +12 -1
- assets/js/ewd-ufaq-blocks.js +17 -0
- includes/Blocks.class.php +6 -0
- includes/CustomPostTypes.class.php +6 -0
- includes/FAQ.class.php +11 -5
- includes/Patterns.class.php +59 -0
- includes/Settings.class.php +7 -4
- includes/patterns/faqs.php +12 -0
- includes/patterns/featured-faqs.php +12 -0
- includes/patterns/search.php +12 -0
- includes/patterns/submit.php +12 -0
- includes/template-functions.php +1 -0
- readme.txt +7 -1
- ultimate-faqs.php +5 -3
- views/View.FAQs.class.php +6 -1
- views/View.class.php +1 -1
assets/css/ewd-ufaq.css
CHANGED
@@ -689,4 +689,15 @@ Pagination
|
|
689 |
100% {
|
690 |
transform: translateX(15px);
|
691 |
}
|
692 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
689 |
100% {
|
690 |
transform: translateX(15px);
|
691 |
}
|
692 |
+
}
|
693 |
+
|
694 |
+
|
695 |
+
/***************
|
696 |
+
BLOCK PATTERNS
|
697 |
+
***************/
|
698 |
+
.ewd-ufaq-pattern-faqs,
|
699 |
+
.ewd-ufaq-pattern-featured-faqs,
|
700 |
+
.ewd-ufaq-pattern-search,
|
701 |
+
.ewd-ufaq-pattern-submit {
|
702 |
+
width: 100%;
|
703 |
+
}
|
assets/js/ewd-ufaq-blocks.js
CHANGED
@@ -15,8 +15,10 @@ registerBlockType( 'ultimate-faqs/ewd-ufaq-display-faq-block', {
|
|
15 |
type: 'string',
|
16 |
default: -1
|
17 |
},
|
|
|
18 |
include_category: { type: 'string' },
|
19 |
exclude_category: { type: 'string' },
|
|
|
20 |
},
|
21 |
|
22 |
edit: function( props ) {
|
@@ -26,18 +28,33 @@ registerBlockType( 'ultimate-faqs/ewd-ufaq-display-faq-block', {
|
|
26 |
el( TextControl, {
|
27 |
type: 'number',
|
28 |
label: Localize( 'Number of FAQs', 'ultimate-faqs' ),
|
|
|
29 |
value: props.attributes.post_count,
|
30 |
onChange: ( value ) => { props.setAttributes( { post_count: value } ); },
|
31 |
} ),
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
el( TextControl, {
|
33 |
label: Localize( 'Include Category', 'ultimate-faqs' ),
|
|
|
34 |
value: props.attributes.include_category,
|
35 |
onChange: ( value ) => { props.setAttributes( { include_category: value } ); },
|
36 |
} ),
|
37 |
el( TextControl, {
|
38 |
label: Localize( 'Exclude Category', 'ultimate-faqs' ),
|
|
|
39 |
value: props.attributes.exclude_category,
|
40 |
onChange: ( value ) => { props.setAttributes( { exclude_category: value } ); },
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
} )
|
42 |
),
|
43 |
);
|
15 |
type: 'string',
|
16 |
default: -1
|
17 |
},
|
18 |
+
group_by_category: { type: 'string' },
|
19 |
include_category: { type: 'string' },
|
20 |
exclude_category: { type: 'string' },
|
21 |
+
post__in_string: { type: 'string' },
|
22 |
},
|
23 |
|
24 |
edit: function( props ) {
|
28 |
el( TextControl, {
|
29 |
type: 'number',
|
30 |
label: Localize( 'Number of FAQs', 'ultimate-faqs' ),
|
31 |
+
help: Localize( 'The default of -1 means to display all FAQs.', 'ultimate-faqs' ),
|
32 |
value: props.attributes.post_count,
|
33 |
onChange: ( value ) => { props.setAttributes( { post_count: value } ); },
|
34 |
} ),
|
35 |
+
el( SelectControl, {
|
36 |
+
label: Localize( 'Group FAQs by Category', 'ultimate-faqs' ),
|
37 |
+
value: props.attributes.group_by_category,
|
38 |
+
options: [ {value: 'yes', label: 'Yes'}, {value: 'no', label: 'No'} ],
|
39 |
+
onChange: ( value ) => { props.setAttributes( { group_by_category: value } ); },
|
40 |
+
} ),
|
41 |
el( TextControl, {
|
42 |
label: Localize( 'Include Category', 'ultimate-faqs' ),
|
43 |
+
help: Localize( 'Comma-separated list of category IDs you\'d like to include.', 'ultimate-faqs' ),
|
44 |
value: props.attributes.include_category,
|
45 |
onChange: ( value ) => { props.setAttributes( { include_category: value } ); },
|
46 |
} ),
|
47 |
el( TextControl, {
|
48 |
label: Localize( 'Exclude Category', 'ultimate-faqs' ),
|
49 |
+
help: Localize( 'Comma-separated list of category IDs you\'d like to exclude.', 'ultimate-faqs' ),
|
50 |
value: props.attributes.exclude_category,
|
51 |
onChange: ( value ) => { props.setAttributes( { exclude_category: value } ); },
|
52 |
+
} ),
|
53 |
+
el( TextControl, {
|
54 |
+
label: Localize( 'FAQ IDs', 'ultimate-faqs' ),
|
55 |
+
help: Localize( 'Comma-separated list of IDs, if you\'d like to display specific FAQs.', 'ultimate-faqs' ),
|
56 |
+
value: props.attributes.post__in_string,
|
57 |
+
onChange: ( value ) => { props.setAttributes( { post__in_string: value } ); },
|
58 |
} )
|
59 |
),
|
60 |
);
|
includes/Blocks.class.php
CHANGED
@@ -32,12 +32,18 @@ class ewdufaqBlocks {
|
|
32 |
'type' => 'string',
|
33 |
'default' => -1
|
34 |
),
|
|
|
|
|
|
|
35 |
'include_category' => array(
|
36 |
'type' => 'string',
|
37 |
),
|
38 |
'exclude_category' => array(
|
39 |
'type' => 'string',
|
40 |
),
|
|
|
|
|
|
|
41 |
),
|
42 |
'render_callback' => 'ewd_ufaq_faqs_shortcode',
|
43 |
);
|
32 |
'type' => 'string',
|
33 |
'default' => -1
|
34 |
),
|
35 |
+
'group_by_category' => array(
|
36 |
+
'type' => 'string',
|
37 |
+
),
|
38 |
'include_category' => array(
|
39 |
'type' => 'string',
|
40 |
),
|
41 |
'exclude_category' => array(
|
42 |
'type' => 'string',
|
43 |
),
|
44 |
+
'post__in_string' => array(
|
45 |
+
'type' => 'string',
|
46 |
+
),
|
47 |
),
|
48 |
'render_callback' => 'ewd_ufaq_faqs_shortcode',
|
49 |
);
|
includes/CustomPostTypes.class.php
CHANGED
@@ -421,6 +421,7 @@ class ewdufaqCustomPostTypes {
|
|
421 |
|
422 |
$defaults['ewd_ufaq_views'] = __( '# of Views', 'ultimate-faqs' );
|
423 |
$defaults['ewd_ufaq_categories'] = __( 'Categories', 'ultimate-faqs' );
|
|
|
424 |
$defaults['ewd_ufaq_id'] = __( 'Post ID', 'ultimate-faqs' );
|
425 |
|
426 |
return $defaults;
|
@@ -443,6 +444,11 @@ class ewdufaqCustomPostTypes {
|
|
443 |
echo get_the_term_list($post_id, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, '', ', ', '');
|
444 |
}
|
445 |
|
|
|
|
|
|
|
|
|
|
|
446 |
if ( $column_name == 'ewd_ufaq_id' ) {
|
447 |
|
448 |
echo $post_id;
|
421 |
|
422 |
$defaults['ewd_ufaq_views'] = __( '# of Views', 'ultimate-faqs' );
|
423 |
$defaults['ewd_ufaq_categories'] = __( 'Categories', 'ultimate-faqs' );
|
424 |
+
$defaults['ewd_ufaq_tags'] = __( 'Tags', 'ultimate-faqs' );
|
425 |
$defaults['ewd_ufaq_id'] = __( 'Post ID', 'ultimate-faqs' );
|
426 |
|
427 |
return $defaults;
|
444 |
echo get_the_term_list($post_id, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, '', ', ', '');
|
445 |
}
|
446 |
|
447 |
+
if ( $column_name == 'ewd_ufaq_tags' ) {
|
448 |
+
|
449 |
+
echo get_the_term_list($post_id, EWD_UFAQ_FAQ_TAG_TAXONOMY, '', ', ', '');
|
450 |
+
}
|
451 |
+
|
452 |
if ( $column_name == 'ewd_ufaq_id' ) {
|
453 |
|
454 |
echo $post_id;
|
includes/FAQ.class.php
CHANGED
@@ -84,8 +84,6 @@ class ewdufaqFAQ {
|
|
84 |
public function load_custom_fields() {
|
85 |
global $ewd_ufaq_controller;
|
86 |
|
87 |
-
$this->score = get_post_meta( $this->ID, 'EWD_UFAQ_Overall_Score', true );
|
88 |
-
|
89 |
$custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
|
90 |
|
91 |
foreach ( $custom_fields as $custom_field ) {
|
@@ -168,12 +166,20 @@ class ewdufaqFAQ {
|
|
168 |
$modified_code = intval( $_POST['ewd_ufaq_modified_captcha'] );
|
169 |
$user_code = intval( $_POST['ewd_ufaq_captcha'] );
|
170 |
|
171 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
$this->validation_errors[] = array(
|
174 |
'field' => 'captcha',
|
175 |
'error_msg' => 'Captcha incorrect',
|
176 |
-
'message' =>
|
177 |
);
|
178 |
}
|
179 |
}
|
@@ -186,7 +192,7 @@ class ewdufaqFAQ {
|
|
186 |
$this->validation_errors[] = array(
|
187 |
'field' => 'faq_question',
|
188 |
'error_msg' => 'Question is blank',
|
189 |
-
'message' =>
|
190 |
);
|
191 |
}
|
192 |
|
84 |
public function load_custom_fields() {
|
85 |
global $ewd_ufaq_controller;
|
86 |
|
|
|
|
|
87 |
$custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
|
88 |
|
89 |
foreach ( $custom_fields as $custom_field ) {
|
166 |
$modified_code = intval( $_POST['ewd_ufaq_modified_captcha'] );
|
167 |
$user_code = intval( $_POST['ewd_ufaq_captcha'] );
|
168 |
|
169 |
+
if ( empty( $user_code ) ) {
|
170 |
+
|
171 |
+
$this->validation_errors[] = array(
|
172 |
+
'field' => 'captcha',
|
173 |
+
'error_msg' => 'Captcha incorrect',
|
174 |
+
'message' => $ewd_ufaq_controller->settings->get_setting( 'label-captcha-empty' ),
|
175 |
+
);
|
176 |
+
}
|
177 |
+
elseif ( $user_code != $this->decrypt_modified_code( $modified_code ) ) {
|
178 |
|
179 |
$this->validation_errors[] = array(
|
180 |
'field' => 'captcha',
|
181 |
'error_msg' => 'Captcha incorrect',
|
182 |
+
'message' => $ewd_ufaq_controller->settings->get_setting( 'label-captcha-incorrect' ),
|
183 |
);
|
184 |
}
|
185 |
}
|
192 |
$this->validation_errors[] = array(
|
193 |
'field' => 'faq_question',
|
194 |
'error_msg' => 'Question is blank',
|
195 |
+
'message' => $ewd_ufaq_controller->settings->get_setting( 'label-no-question-title-entered' ),
|
196 |
);
|
197 |
}
|
198 |
|
includes/Patterns.class.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
+
|
4 |
+
if ( ! class_exists( 'ewdufaqPatterns' ) ) {
|
5 |
+
/**
|
6 |
+
* Class to handle plugin Gutenberg blocks
|
7 |
+
*
|
8 |
+
* @since 2.1.16
|
9 |
+
*/
|
10 |
+
class ewdufaqPatterns {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Add hooks
|
14 |
+
* @since 2.1.16
|
15 |
+
*/
|
16 |
+
public function __construct() {
|
17 |
+
|
18 |
+
add_action( 'init', array( $this, 'ewd_ufaq_add_pattern_category' ) );
|
19 |
+
add_action( 'init', array( $this, 'ewd_ufaq_add_patterns' ) );
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Register block patterns
|
24 |
+
* @since 2.1.16
|
25 |
+
*/
|
26 |
+
public function ewd_ufaq_add_patterns() {
|
27 |
+
|
28 |
+
$block_patterns = array(
|
29 |
+
'faqs',
|
30 |
+
'featured-faqs',
|
31 |
+
'search',
|
32 |
+
'submit',
|
33 |
+
);
|
34 |
+
|
35 |
+
foreach ( $block_patterns as $block_pattern ) {
|
36 |
+
$pattern_file = EWD_UFAQ_PLUGIN_DIR . '/includes/patterns/' . $block_pattern . '.php';
|
37 |
+
|
38 |
+
register_block_pattern(
|
39 |
+
'ultimate-faqs/' . $block_pattern,
|
40 |
+
require $pattern_file
|
41 |
+
);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Create a new category of block patterns to hold our pattern(s)
|
47 |
+
* @since 2.1.16
|
48 |
+
*/
|
49 |
+
public function ewd_ufaq_add_pattern_category() {
|
50 |
+
|
51 |
+
register_block_pattern_category(
|
52 |
+
'ewd-ufaq-block-patterns',
|
53 |
+
array(
|
54 |
+
'label' => __( 'Ultimate FAQs', 'ultimate-faqs' )
|
55 |
+
)
|
56 |
+
);
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
includes/Settings.class.php
CHANGED
@@ -71,10 +71,13 @@ class ewdufaqSettings {
|
|
71 |
'styling-category-heading-type' => 'h3',
|
72 |
'styling-faq-heading-type' => 'h4',
|
73 |
|
74 |
-
'label-retrieving-results'
|
75 |
-
'label-no-results-found'
|
76 |
-
'label-woocommerce-tab'
|
77 |
-
'label-
|
|
|
|
|
|
|
78 |
);
|
79 |
|
80 |
$this->defaults = apply_filters( 'ewd_ufaq_defaults', $this->defaults, $this );
|
71 |
'styling-category-heading-type' => 'h3',
|
72 |
'styling-faq-heading-type' => 'h4',
|
73 |
|
74 |
+
'label-retrieving-results' => __( 'Retrieving Results', 'ultimate-faqs' ),
|
75 |
+
'label-no-results-found' => __( 'No result FAQ\'s contained the term \'%s\'', 'ultimate-faqs' ),
|
76 |
+
'label-woocommerce-tab' => __( 'FAQs', 'ultimate-faqs' ),
|
77 |
+
'label-captcha-empty' => __( 'Please fill out the image number field.', 'ultimate-faqs' ),
|
78 |
+
'label-captcha-incorrect' => __( 'The number you entered for the image was incorrect.', 'ultimate-faqs' ),
|
79 |
+
'label-no-question-title-entered' => __( 'Please make sure that there is a question that you are submitting as an FAQ.', 'ultimate-faqs' ),
|
80 |
+
'label-thank-you-submit' => __( 'Thank you for submitting an FAQ.', 'ultimate-faqs' ),
|
81 |
);
|
82 |
|
83 |
$this->defaults = apply_filters( 'ewd_ufaq_defaults', $this->defaults, $this );
|
includes/patterns/faqs.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FAQs
|
4 |
+
*/
|
5 |
+
return array(
|
6 |
+
'title' => __( 'FAQs', 'ultimate-faqs' ),
|
7 |
+
'description' => _x( 'Adds your FAQs.', 'Block pattern description', 'ultimate-faqs' ),
|
8 |
+
'categories' => array( 'ewd-ufaq-block-patterns' ),
|
9 |
+
'content' => '<!-- wp:group {"className":"ewd-ufaq-pattern-faqs"} -->
|
10 |
+
<div class="wp-block-group ewd-ufaq-pattern-faqs"><!-- wp:ultimate-faqs/ewd-ufaq-display-faq-block /--></div>
|
11 |
+
<!-- /wp:group -->',
|
12 |
+
);
|
includes/patterns/featured-faqs.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Featured FAQs
|
4 |
+
*/
|
5 |
+
return array(
|
6 |
+
'title' => __( 'Featured FAQs', 'ultimate-faqs' ),
|
7 |
+
'description' => _x( 'Adds a list of featured FAQs. Use the available block attributes to specify which FAQs you would like to show.', 'Block pattern description', 'ultimate-faqs' ),
|
8 |
+
'categories' => array( 'ewd-ufaq-block-patterns' ),
|
9 |
+
'content' => '<!-- wp:group {"className":"ewd-ufaq-pattern-featured-faqs"} -->
|
10 |
+
<div class="wp-block-group ewd-ufaq-pattern-featured-faqs"><!-- wp:ultimate-faqs/ewd-ufaq-display-faq-block {"post_count":"5","group_by_category":"no"} /--></div>
|
11 |
+
<!-- /wp:group -->',
|
12 |
+
);
|
includes/patterns/search.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Search FAQs
|
4 |
+
*/
|
5 |
+
return array(
|
6 |
+
'title' => __( 'Search FAQs', 'ultimate-faqs' ),
|
7 |
+
'description' => _x( 'Adds the FAQ search form.', 'Block pattern description', 'ultimate-faqs' ),
|
8 |
+
'categories' => array( 'ewd-ufaq-block-patterns' ),
|
9 |
+
'content' => '<!-- wp:group {"className":"ewd-ufaq-pattern-search"} -->
|
10 |
+
<div class="wp-block-group ewd-ufaq-pattern-search"><!-- wp:ultimate-faqs/ewd-ufaq-search-block /--></div>
|
11 |
+
<!-- /wp:group -->',
|
12 |
+
);
|
includes/patterns/submit.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Submit Question
|
4 |
+
*/
|
5 |
+
return array(
|
6 |
+
'title' => __( 'Submit Question', 'ultimate-faqs' ),
|
7 |
+
'description' => _x( 'Adds the submit question form.', 'Block pattern description', 'ultimate-faqs' ),
|
8 |
+
'categories' => array( 'ewd-ufaq-block-patterns' ),
|
9 |
+
'content' => '<!-- wp:group {"className":"ewd-ufaq-pattern-submit"} -->
|
10 |
+
<div class="wp-block-group ewd-ufaq-pattern-submit"><!-- wp:ultimate-faqs/ewd-ufaq-submit-faq-block /--></div>
|
11 |
+
<!-- /wp:group -->',
|
12 |
+
);
|
includes/template-functions.php
CHANGED
@@ -22,6 +22,7 @@ function ewd_ufaq_faqs_shortcode( $atts ) {
|
|
22 |
'orderby' => '',
|
23 |
'order' => '',
|
24 |
'display_all_answers' => '',
|
|
|
25 |
'faq_page' => 1,
|
26 |
'post_count' => -1
|
27 |
);
|
22 |
'orderby' => '',
|
23 |
'order' => '',
|
24 |
'display_all_answers' => '',
|
25 |
+
'group_by_category' => '',
|
26 |
'faq_page' => 1,
|
27 |
'post_count' => -1
|
28 |
);
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Rustaurius, EtoileWebDesign
|
|
3 |
Tags: faq, faqs, accordion, woocommerce faq, gutenberg faq, faq block
|
4 |
Requires at least: 5.0
|
5 |
Tested up to: 6.0
|
6 |
-
Stable tag: 2.1.
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -267,6 +267,12 @@ Video 3 - FAQs Ordering
|
|
267 |
|
268 |
== Changelog ==
|
269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
= 2.1.15 (2022-06-10) =
|
271 |
- Fixed an issue in which FAQs were sometimes showing on archive pages for other custom post types if there was nothing selected for the FAQ Page setting.
|
272 |
|
3 |
Tags: faq, faqs, accordion, woocommerce faq, gutenberg faq, faq block
|
4 |
Requires at least: 5.0
|
5 |
Tested up to: 6.0
|
6 |
+
Stable tag: 2.1.16
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
267 |
|
268 |
== Changelog ==
|
269 |
|
270 |
+
= 2.1.16 (2022-08-12) =
|
271 |
+
- Introducing new block patterns, which can be used to integrate FAQs directly into your block-based theme templates.
|
272 |
+
- Added a parameter to the Display FAQs block, as well as an attribute to the ultimate-faqs shortcode, that lets you enable/disable grouping FAQs by category for that specific instance.
|
273 |
+
- Added a Tags column to the main admin FAQs overview/table.
|
274 |
+
- Updated the success/failure/validation messaging for the submit question form and added labelling options for these.
|
275 |
+
|
276 |
= 2.1.15 (2022-06-10) =
|
277 |
- Fixed an issue in which FAQs were sometimes showing on archive pages for other custom post types if there was nothing selected for the FAQ Page setting.
|
278 |
|
ultimate-faqs.php
CHANGED
@@ -6,9 +6,9 @@ Description: FAQ and accordion plugin with easy to use Gutenberg blocks, shortco
|
|
6 |
Author URI: https://www.etoilewebdesign.com/
|
7 |
Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
|
8 |
Text Domain: ultimate-faqs
|
9 |
-
Version: 2.1.
|
10 |
WC requires at least: 3.0
|
11 |
-
WC tested up to: 6.
|
12 |
*/
|
13 |
|
14 |
if ( ! defined( 'ABSPATH' ) )
|
@@ -46,7 +46,7 @@ class ewdufaqInit {
|
|
46 |
define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
|
47 |
define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
|
48 |
define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
|
49 |
-
define( 'EWD_UFAQ_VERSION', '2.1.
|
50 |
|
51 |
define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
|
52 |
define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
|
@@ -64,6 +64,7 @@ class ewdufaqInit {
|
|
64 |
|
65 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Ajax.class.php' );
|
66 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Blocks.class.php' );
|
|
|
67 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/CustomPostTypes.class.php' );
|
68 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Dashboard.class.php' );
|
69 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/DeactivationSurvey.class.php' );
|
@@ -113,6 +114,7 @@ class ewdufaqInit {
|
|
113 |
|
114 |
new ewdufaqAJAX();
|
115 |
new ewdufaqBlocks();
|
|
|
116 |
new ewdufaqNotifications();
|
117 |
new ewdufaqOrderingTable();
|
118 |
new ewdufaqUltimateWPMail();
|
6 |
Author URI: https://www.etoilewebdesign.com/
|
7 |
Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
|
8 |
Text Domain: ultimate-faqs
|
9 |
+
Version: 2.1.16
|
10 |
WC requires at least: 3.0
|
11 |
+
WC tested up to: 6.8
|
12 |
*/
|
13 |
|
14 |
if ( ! defined( 'ABSPATH' ) )
|
46 |
define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
|
47 |
define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
|
48 |
define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
|
49 |
+
define( 'EWD_UFAQ_VERSION', '2.1.16' );
|
50 |
|
51 |
define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
|
52 |
define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
|
64 |
|
65 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Ajax.class.php' );
|
66 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Blocks.class.php' );
|
67 |
+
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Patterns.class.php' );
|
68 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/CustomPostTypes.class.php' );
|
69 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Dashboard.class.php' );
|
70 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/DeactivationSurvey.class.php' );
|
114 |
|
115 |
new ewdufaqAJAX();
|
116 |
new ewdufaqBlocks();
|
117 |
+
new ewdufaqPatterns();
|
118 |
new ewdufaqNotifications();
|
119 |
new ewdufaqOrderingTable();
|
120 |
new ewdufaqUltimateWPMail();
|
views/View.FAQs.class.php
CHANGED
@@ -36,7 +36,12 @@ class ewdufaqViewFAQs extends ewdufaqView {
|
|
36 |
global $ewd_ufaq_controller;
|
37 |
|
38 |
$this->display_all_answers = sizeOf( $faqs ) == 1 ? true : $this->display_all_answers;
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
foreach ( $faqs as $faq ) {
|
42 |
|
36 |
global $ewd_ufaq_controller;
|
37 |
|
38 |
$this->display_all_answers = sizeOf( $faqs ) == 1 ? true : $this->display_all_answers;
|
39 |
+
|
40 |
+
// Set the group_by_category property based on the shortcode attribute, default to the setting's value
|
41 |
+
$this->group_by_category = ! empty( $this->group_by_category ) ? ( strtolower( $this->group_by_category ) == 'yes' ? true : false ) : $ewd_ufaq_controller->settings->get_setting( 'group-by-category' );
|
42 |
+
|
43 |
+
// Override the group by category setting if there's only a single FAQ being displayed
|
44 |
+
$this->group_by_category = sizeOf( $faqs ) == 1 ? false : $this->group_by_category;
|
45 |
|
46 |
foreach ( $faqs as $faq ) {
|
47 |
|
views/View.class.php
CHANGED
@@ -251,7 +251,7 @@ class ewdufaqView extends ewdufaqBase {
|
|
251 |
}
|
252 |
|
253 |
/**
|
254 |
-
*
|
255 |
*
|
256 |
* @since 2.1.11
|
257 |
*/
|
251 |
}
|
252 |
|
253 |
/**
|
254 |
+
* ??
|
255 |
*
|
256 |
* @since 2.1.11
|
257 |
*/
|