| 1 |
<?php |
| 2 |
/** |
| 3 |
* Displays the donate button to be displayed within campaign loops. |
| 4 |
* |
| 5 |
* Override this template by copying it to yourtheme/charitable/campaign-loop/donate-link.php |
| 6 |
* |
| 7 |
* @author Studio 164a |
| 8 |
* @since 1.0.0 |
| 9 |
* @version 1.5.0 |
| 10 |
*/ |
| 11 |
|
| 12 |
// Exit if accessed directly. |
| 13 |
if ( ! defined( 'ABSPATH' ) ) { exit; } |
| 14 |
|
| 15 |
/** |
| 16 |
* @var Charitable_Campaign |
| 17 |
*/ |
| 18 |
$campaign = $view_args['campaign']; |
| 19 |
|
| 20 |
if ( ! $campaign->can_receive_donations() ) : |
| 21 |
return; |
| 22 |
endif; |
| 23 |
|
| 24 |
?> |
| 25 |
<div class="campaign-donation"> |
| 26 |
<a class="donate-button button" href="<?php echo charitable_get_permalink( 'campaign_donation_page', array( 'campaign_id' => $campaign->ID ) ) ?>" aria-label="<?php echo esc_attr( sprintf( _x( 'Make a donation to %s', 'make a donation to campaign', 'charitable' ), get_the_title( $campaign->ID ) ) ) ?>"><?php _e( 'Donate', 'charitable' ) ?></a> |
| 27 |
</div> |
| 28 |
|