PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.6.6
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.6.6
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 1.8.0 All 210 releases
charitable / templates / donor-loop.php

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

63 lines 1.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 list of donors, either for a specific campaign or sitewide.
4 *
5 * Override this template by copying it to yourtheme/charitable/donor-loop.php
6 *
7 * @package Charitable/Templates/Donor
8 * @author Studio 164a
9 * @since 1.5.0
10 * @version 1.5.0
11 */
12
13 // Exit if accessed directly.
14 if ( ! defined( 'ABSPATH' ) ) { exit; }
15
16 /* Donors have to be included in the view args. */
17 if ( ! array_key_exists( 'donors', $view_args ) ) {
18 return;
19 }
20
21 $donors = $view_args['donors'];
22 $args = $view_args;
23 $campaign_id = $view_args['campaign'];
24
25 if ( ! charitable_is_campaign_page() && 'current' === $campaign_id ) {
26 return;
27 }
28
29 if ( 'all' == $campaign_id ) {
30 $args['campaign'] = false;
31 } elseif ( 'current' == $campaign_id ) {
32 $args['campaign'] = get_the_ID();
33 }
34
35 $orientation = array_key_exists( 'orientation', $view_args ) ? $view_args['orientation'] : 'vertical';
36 $style = '';
37
38 if ( 'horizontal' == $orientation ) {
39 $width = array_key_exists( 'width', $view_args ) ? $view_args['width'] : get_option( 'thumbnail_size_w', 100 );
40 if ( 100 != $width ) {
41 $style = '<style>.donors-list.donors-list-horizontal .donor{ width:' . $width . 'px; }</style>';
42 }
43 }
44
45 if ( $donors->count() ) :
46 echo $style;
47 ?>
48 <ol class="donors-list donors-list-<?php echo $orientation; ?>">
49 <?php
50 foreach ( $donors as $donor ) :
51
52 $args['donor'] = $donor;
53
54 charitable_template( 'donor-loop/donor.php', $args );
55
56 endforeach;
57 ?>
58 </ol>
59 <?php else : ?>
60 <p><?php _e( 'No donors yet. Be the first!', 'charitable' ); ?></p>
61 <?php
62 endif;
63