| 1 |
<?php |
| 2 |
/** |
| 3 |
* The Template for displaying Filters found posts number. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/filters/posts-found.php. |
| 6 |
* |
| 7 |
* $posts_found - int|NULL, posts found number |
| 8 |
* $singular_label - string label for single found post |
| 9 |
* $plural_label - string label for multiple found posts |
| 10 |
* $hidden - makes an element hidden |
| 11 |
* |
| 12 |
* @see https://filtereverything.pro/resources/templates-overriding/ |
| 13 |
*/ |
| 14 |
|
| 15 |
if ( ! defined('ABSPATH') ) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
?> |
| 20 |
<div class="wpc-posts-found<?php echo ($hidden) ? " wpc-posts-found-hidden" : ''; ?>" data-found="<?php echo esc_attr( $posts_found_count ); ?>"> |
| 21 |
<?php if( !$hidden ) : ?> |
| 22 |
<p><?php |
| 23 |
if( $posts_found_count !== NULL ) { |
| 24 |
$class = ( $posts_found_count > 1 ) ? 'wpc-posts-found-number wpc-plural' : 'wpc-posts-found-number'; |
| 25 |
$label = ( $posts_found_count > 1 ) ? $plural_label : $singular_label; |
| 26 |
|
| 27 |
echo wp_kses( |
| 28 |
sprintf( _n( |
| 29 |
'<span class="%s">%d</span> %s found', |
| 30 |
'<span class="%s">%d</span> %s found', |
| 31 |
$posts_found_count, |
| 32 |
'filter-everything' |
| 33 |
), $class, $posts_found_count, $label ), |
| 34 |
array( |
| 35 |
'span' => array('class' => true) |
| 36 |
) |
| 37 |
); |
| 38 |
|
| 39 |
}else{ |
| 40 |
echo ' '; |
| 41 |
} |
| 42 |
?></p> |
| 43 |
<?php endif; ?> |
| 44 |
</div> |