| @@ -1,19 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | -// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 2 | +$faq_terms = get_terms( betterdocs()->query->faq_terms_query_args() ); | |
| 3 | 3 | |
| 4 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | - exit; | |
| 6 | -} | |
| 7 | -$_faq_taxonomy = isset( $shortcode_attr['faq_taxonomy'] ) ? sanitize_key( $shortcode_attr['faq_taxonomy'] ) : 'betterdocs_faq_category'; | |
| 8 | -$faq_terms = get_terms( betterdocs()->query->faq_terms_query_args( '', '', [], $_faq_taxonomy ) ); | |
| 9 | - | |
| 10 | 4 | if ( $enable && $have_posts && ! empty( $faq_terms ) ) { |
| 11 | - // Only use settings value if faq_schema is not already set in shortcode attributes | |
| 12 | - if ( ! isset( $shortcode_attr['faq_schema'] ) ) { | |
| 13 | - $enable_faq_schema = betterdocs()->settings->get( 'enable_faq_schema' ); | |
| 14 | - $shortcode_attr['faq_schema'] = $enable_faq_schema; | |
| 15 | - } | |
| 5 | + $enable_faq_schema = betterdocs()->settings->get( 'enable_faq_schema' ); | |
| 6 | + $shortcode_attr['faq_schema'] = $enable_faq_schema; | |
| 16 | 7 | |
| 17 | 8 | $attributes = betterdocs()->template_helper->get_html_attributes( $shortcode_attr ); |
| 18 | 9 | |
| 19 | 10 | if ( $layout === 'layout-1' ) { |