| @@ -1,6 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | -$faq_terms = get_terms( betterdocs()->query->faq_terms_query_args() ); | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 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 ) ); | |
| 3 | 9 | |
| 4 | 10 | if ( $enable && $have_posts && ! empty( $faq_terms ) ) { |
| 5 | 11 | // Only use settings value if faq_schema is not already set in shortcode attributes |
| 6 | 12 | if ( ! isset( $shortcode_attr['faq_schema'] ) ) { |