| 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 |
if ( ! isset( $current_category ) ) { |
| 8 |
return; |
| 9 |
} |
| 10 |
|
| 11 |
$count_suffix_singular = betterdocs()->settings->get( 'count_text_singular' ); |
| 12 |
$count_suffix = betterdocs()->settings->get( 'count_text' ); |
| 13 |
$_counts = [ |
| 14 |
'counts' => $found_posts, |
| 15 |
'prefix' => ! empty( $count_prefix ) ? $count_prefix : '', |
| 16 |
'suffix' => ! empty( $count_suffix ) ? $count_suffix : '', |
| 17 |
'suffix_singular' => ! empty( $count_suffix_singular ) ? $count_suffix_singular : '' |
| 18 |
]; |
| 19 |
?> |
| 20 |
|
| 21 |
<div class="<?php echo esc_attr( $blockId ); ?> betterdocs-main-category-folder"> |
| 22 |
<div class="betterdocs-category-header"> |
| 23 |
<div class="betterdocs-category-header-inner"> |
| 24 |
<?php |
| 25 |
$view_object->get( |
| 26 |
'template-parts/category-icon', |
| 27 |
[ |
| 28 |
'show_icon' => $show_icon, |
| 29 |
'category_icon' => 'folder-open', |
| 30 |
'term_id' => isset( $current_category->term_id ) ? $current_category->term_id : '' |
| 31 |
] |
| 32 |
); |
| 33 |
|
| 34 |
$view_object->get( |
| 35 |
'template-parts/category-title', |
| 36 |
[ |
| 37 |
'title' => isset( $current_category->name ) ? $current_category->name : '', |
| 38 |
'tag' => $title_tag |
| 39 |
] |
| 40 |
); |
| 41 |
|
| 42 |
$view_object->get( |
| 43 |
'template-parts/sub-category-counter', |
| 44 |
[ |
| 45 |
'show_count' => $show_count, |
| 46 |
'counts' => $_counts |
| 47 |
] |
| 48 |
); |
| 49 |
?> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
|