| 1 |
<?php |
| 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 = [ |
| 8 |
'data-id' => isset( $term->term_id ) ? $term->term_id : 0, |
| 9 |
'class' => [ 'betterdocs-single-category-wrapper category-grid' ] |
| 10 |
]; |
| 11 |
|
| 12 |
if ( isset( $wrapper_class ) && is_array( $wrapper_class ) && ! empty( $wrapper_class ) ) { |
| 13 |
$attributes['class'] = array_merge( $attributes['class'], $wrapper_class ); |
| 14 |
} |
| 15 |
|
| 16 |
$attributes = betterdocs()->template_helper->get_html_attributes( $attributes ); |
| 17 |
$posts_per_page = isset( $docs_query_args['posts_per_page'] ) ? $docs_query_args['posts_per_page'] : ( isset( $post_per_tab ) ? $post_per_tab : ( isset($post_per_page) ? $post_per_page : 0 ) ); // for category grid, mkb, tab |
| 18 |
$current_term_posts_count = isset( $counts ) && ! is_array( $counts ) ? $counts : ( isset( $counts ) && is_array( $counts ) ? $counts['counts'] : 0 ); |
| 19 |
?> |
| 20 |
|
| 21 |
<article |
| 22 |
<?php echo $attributes; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| 23 |
<?php |
| 24 |
if ( $show_header ) { |
| 25 |
$view_object->get( 'layout-parts/header' ); |
| 26 |
} |
| 27 |
|
| 28 |
if ( $show_list ) { |
| 29 |
$view_object->get( 'template-parts/category-list-2' ); |
| 30 |
} |
| 31 |
?> |
| 32 |
</article> |
| 33 |
|