| 1 |
<?php |
| 2 |
// Exit if accessed directly. |
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
|
| 8 |
/** |
| 9 |
* Display a list of campaign categories or tags. |
| 10 |
* |
| 11 |
* Override this template by copying it to yourtheme/charitable/widgets/campaign-terms.php |
| 12 |
* |
| 13 |
* @package Charitable/Templates/Widgets |
| 14 |
* @author WP Charitable LLC |
| 15 |
* @since 1.0.0 |
| 16 |
* @version 1.0.0 |
| 17 |
*/ |
| 18 |
|
| 19 |
$taxonomy = isset($view_args['taxonomy']) ? $view_args['taxonomy'] : 'campaign_category'; // phpcs:ignore |
| 20 |
$show_count = isset($view_args['show_count']) && $view_args['show_count']; // phpcs:ignore |
| 21 |
$hide_empty = isset($view_args['hide_empty']) && $view_args['hide_empty']; // phpcs:ignore |
| 22 |
|
| 23 |
echo $view_args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 24 |
|
| 25 |
if ( ! empty( $view_args['title'] ) ) : |
| 26 |
|
| 27 |
echo $view_args['before_title'] . esc_html( $view_args['title'] ) . $view_args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 28 |
|
| 29 |
endif; |
| 30 |
?> |
| 31 |
<ul class="charitable-terms-widget"> |
| 32 |
<?php |
| 33 |
wp_list_categories( |
| 34 |
array( |
| 35 |
'title_li' => '', |
| 36 |
'taxonomy' => $taxonomy, |
| 37 |
'show_count' => $show_count, |
| 38 |
'hide_empty' => $hide_empty, |
| 39 |
) |
| 40 |
); |
| 41 |
?> |
| 42 |
</ul><!-- .charitable-terms-widget --> |
| 43 |
<?php |
| 44 |
|
| 45 |
echo $view_args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 46 |
|