| @@ -1,21 +1,26 @@ | ||
| 1 | 1 | <?php |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 2 | 3 | |
| 3 | - $attributes = [ | |
| 4 | - 'href' => esc_url( $permalink ), | |
| 5 | - 'data-id' => isset( $term->term_id ) ? $term->term_id : 0, | |
| 6 | - 'class' => ['betterdocs-single-category-wrapper category-box'] | |
| 7 | - ]; | |
| 4 | + | |
| 5 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | + exit; | |
| 7 | +} | |
| 8 | +$attributes = [ | |
| 9 | + 'href' => esc_url( $permalink ), | |
| 10 | + 'data-id' => isset( $term->term_id ) ? $term->term_id : 0, | |
| 11 | + 'class' => [ 'betterdocs-single-category-wrapper category-box' ] | |
| 12 | + ]; | |
| 8 | 13 | |
| 9 | - if ( isset( $wrapper_class ) && is_array( $wrapper_class ) && ! empty( $wrapper_class ) ) { | |
| 10 | - $attributes['class'] = array_merge( $attributes['class'], $wrapper_class ); | |
| 11 | - } | |
| 14 | + if ( isset( $wrapper_class ) && is_array( $wrapper_class ) && ! empty( $wrapper_class ) ) { | |
| 15 | + $attributes['class'] = array_merge( $attributes['class'], $wrapper_class ); | |
| 16 | + } | |
| 12 | 17 | |
| 13 | - $attributes = betterdocs()->template_helper->get_html_attributes( $attributes ); | |
| 14 | -?> | |
| 18 | + $attributes = betterdocs()->template_helper->get_html_attributes( $attributes ); | |
| 19 | + ?> | |
| 15 | 20 | |
| 16 | 21 | <a |
| 17 | - <?php echo $attributes; ?>> | |
| 22 | + <?php echo $attributes; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> | |
| 18 | 23 | <div class="betterdocs-single-category-inner"> |
| 19 | 24 | <?php $view_object->get( 'layout-parts/header' ); ?> |
| 20 | 25 | </div> |
| 21 | 26 | </a> |