PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13.1 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 All 212 releases
← All changes | templates/donor-loop.php +57 -24 1.7.0.11 → 1.8.13 View file →
@@ -6,9 +6,10 @@
6 6 *
7 7 * @package Charitable/Templates/Donor
8 8 * @author WP Charitable LLC
9 9 * @since 1.5.0
10 - * @version 1.6.31
10 + * @version 1.8.0
11 + * @version 1.8.8.6
11 12 */
12 13
13 14 // Exit if accessed directly.
14 15 if ( ! defined( 'ABSPATH' ) ) {
@@ -19,51 +20,83 @@
19 20 if ( ! array_key_exists( 'donors', $view_args ) ) {
20 21 return;
21 22 }
22 23
23 -$donors = $view_args['donors'];
24 -$args = $view_args;
25 -$campaign_id = $view_args['campaign'];
26 -$hide_if_no_donors = array_key_exists( 'hide_if_no_donors', $view_args ) && $view_args['hide_if_no_donors'];
24 +$charitable_donors = $view_args['donors'];
25 +$charitable_args = $view_args;
26 +$charitable_campaign_id = $view_args['campaign'];
27 +$charitable_hide_if_no_donors = array_key_exists( 'hide_if_no_donors', $view_args ) && $view_args['hide_if_no_donors'];
27 28
28 -if ( ! charitable_is_campaign_page() && 'current' === $campaign_id ) {
29 +if ( ! charitable_is_campaign_page() && 'current' === $charitable_campaign_id ) {
29 30 return;
30 31 }
31 32
32 -if ( ! $donors->count() && $hide_if_no_donors ) {
33 +if ( ! $charitable_donors->count() && $charitable_hide_if_no_donors ) {
33 34 return;
34 35 }
35 36
36 -if ( 'all' == $campaign_id ) {
37 - $args['campaign'] = false;
38 -} elseif ( 'current' == $campaign_id ) {
39 - $args['campaign'] = get_the_ID();
37 +if ( 'all' == $charitable_campaign_id ) {
38 + $charitable_args['campaign'] = false;
39 +} elseif ( 'current' == $charitable_campaign_id ) {
40 + $charitable_args['campaign'] = get_the_ID();
40 41 }
41 42
42 -$orientation = array_key_exists( 'orientation', $view_args ) ? $view_args['orientation'] : 'vertical';
43 -$style = '';
43 +$charitable_orientation = array_key_exists( 'orientation', $view_args ) ? $view_args['orientation'] : 'vertical';
44 +$charitable_style = '';
44 45
45 -if ( 'horizontal' == $orientation ) {
46 - $width = array_key_exists( 'width', $view_args ) ? $view_args['width'] : get_option( 'thumbnail_size_w', 100 );
47 - if ( 100 != $width ) {
48 - $style = '<style>.donors-list.donors-list-horizontal .donor{ width:' . $width . 'px; }</style>';
46 +if ( 'horizontal' == $charitable_orientation ) {
47 + $charitable_width = array_key_exists( 'width', $view_args ) ? $view_args['width'] : get_option( 'thumbnail_size_w', 100 );
48 + if ( 100 !== $charitable_width ) {
49 + $charitable_style = '<style>.donors-list.donors-list-horizontal .donor{ width:' . intval( $charitable_width ) . 'px; }</style>';
49 50 }
50 51 }
51 52
52 -if ( $donors->count() ) :
53 - echo $style;
53 +/**
54 + * Add something before the donors loop logic.
55 + *
56 + * @since 1.8.1.12
57 + *
58 + * @param mixed $campaign_id The campaign ID.
59 + * @param array $args Loop args.
60 + */
61 +do_action( 'charitable_donor_list_before', $charitable_campaign_id, $charitable_args );
62 +
63 +if ( $charitable_donors->count() ) :
64 + echo $charitable_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
65 +
66 + /**
67 + * Add something before the donors loop.
68 + *
69 + * @since 1.8.1.12
70 + *
71 + * @param array $donors The donors.
72 + * @param mixed $campaign_id The campaign ID.
73 + * @param array $args Loop args.
74 + */
75 + do_action( 'charitable_donor_list_loop_before', $charitable_donors, $charitable_campaign_id, $charitable_args );
76 +
54 77 ?>
55 - <ol class="donors-list donors-list-<?php echo $orientation; ?>">
78 + <ol class="donors-list donors-list-<?php echo esc_attr( $charitable_orientation ); ?>">
56 79 <?php
57 - foreach ( $donors as $donor ) :
80 + foreach ( $charitable_donors as $charitable_donor ) :
58 81
59 - $args['donor'] = $donor;
82 + $charitable_args['donor'] = $charitable_donor;
60 83
61 - charitable_template( 'donor-loop/donor.php', $args );
84 + charitable_template( 'donor-loop/donor.php', $charitable_args );
62 85
63 86 endforeach;
64 87 ?>
65 88 </ol>
66 89 <?php else : ?>
67 - <p><?php _e( 'No donors yet. Be the first!', 'charitable' ); ?></p>
90 + <p><?php echo esc_html__( 'No donors yet. Be the first!', 'charitable' ); ?></p>
68 91 <?php
69 92 endif;
93 +
94 +/**
95 + * Add something before the donors loop logic.
96 + *
97 + * @since 1.8.1.12
98 + *
99 + * @param mixed $campaign_id The campaign ID.
100 + * @param array $args Loop args.
101 + */
102 +do_action( 'charitable_donor_list_after', $charitable_campaign_id, $charitable_args );