| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | - $attributes = [ | |
| 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 | +$attributes = [ | |
| 3 | 8 | 'href' => esc_url( $permalink ), |
| 4 | 9 | 'data-id' => isset( $term->term_id ) ? esc_attr( $term->term_id ) : 0, |
| 5 | 10 | 'class' => [ 'category-box category-' . esc_attr( $term->slug ) ] |
| 6 | 11 | ]; |