PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.7
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.7
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / templates / donor-loop / donor.php

donor.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0.7, at templates/donor-loop/donor.php

111 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Display a single donor within a loop.
4 *
5 * Override this template by copying it to yourtheme/charitable/donor-loop/donor.php
6 *
7 * @package Charitable/Templates/Donor
8 * @author WP Charitable LLC
9 * @since 1.5.0
10 * @version 1.5.0
11 */
12
13 // Exit if accessed directly.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 /* Donor has to be included in the view args. */
19 if ( ! array_key_exists( 'donor', $view_args ) ) {
20 return;
21 }
22
23 /* @var Charitable_Donor */
24 $donor = $view_args['donor'];
25
26 /* @var int */
27 $campaign_id = $view_args['campaign'];
28
29 ?>
30 <li class="donor">
31 <?php
32 /**
33 * Add output before the donor's avatar, name, etc.
34 *
35 * @since 1.5.0
36 *
37 * @param Charitable_Donor $donor The Donor object.
38 * @param array $view_args View arguments.
39 */
40 do_action( 'charitable_donor_loop_before_donor', $donor, $view_args );
41
42 if ( $view_args['show_avatar'] ) :
43 echo $donor->get_avatar();
44 endif;
45
46 if ( $view_args['show_name'] ) :
47 ?>
48 <p class="donor-name">
49 <?php
50 /**
51 * Filter the name displayed for the donor.
52 *
53 * @since 1.5.0
54 *
55 * @param string $name The name to be displayed.
56 * @param array $view_args View arguments.
57 */
58 echo apply_filters( 'charitable_donor_loop_donor_name', $donor->get_name(), $view_args );
59 ?>
60 </p>
61 <?php
62 endif;
63
64 if ( $view_args['show_location'] && strlen( $donor->get_location() ) ) :
65 ?>
66 <div class="donor-location">
67 <?php
68 /**
69 * Filter the location displayed for the donor.
70 *
71 * @since 1.5.0
72 *
73 * @param string $location The location to be displayed.
74 * @param array $view_args View arguments.
75 */
76 echo apply_filters( 'charitable_donor_loop_donor_location', $donor->get_location(), $view_args );
77 ?>
78 </div>
79 <?php
80 endif;
81
82 if ( $view_args['show_amount'] ) :
83 ?>
84 <div class="donor-donation-amount">
85 <?php
86 /**
87 * Filter the amount displayed for the donor.
88 *
89 * @since 1.5.0
90 *
91 * @param string $amount The amount to be displayed.
92 * @param array $view_args View arguments.
93 */
94 echo apply_filters( 'charitable_donor_loop_donor_amount', charitable_format_money( $donor->get_amount( $campaign_id ) ), $view_args );
95 ?>
96 </div>
97 <?php
98 endif;
99
100 /**
101 * Add output after the donor's avatar, name, etc.
102 *
103 * @since 1.5.0
104 *
105 * @param Charitable_Donor $donor The Donor object.
106 * @param array $view_args View arguments.
107 */
108 do_action( 'charitable_donor_loop_after_donor', $donor, $view_args );
109 ?>
110 </li><!-- .donor-<?php echo $donor->donor_id; ?> -->
111