| 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 |
* @package Charitable/Templates/Campaign |
| 9 |
* @since 1.0.0 |
| 10 |
* @version 1.6.29 |
| 11 |
*/ |
| 12 |
|
| 13 |
// Exit if accessed directly. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
|
| 18 |
/* @var Charitable_Campaign */ |
| 19 |
$campaign = $view_args['campaign']; |
| 20 |
|
| 21 |
if ( ! $campaign->can_receive_donations() ) : |
| 22 |
return; |
| 23 |
endif; |
| 24 |
|
| 25 |
?> |
| 26 |
<div class="campaign-donation"> |
| 27 |
<a class="<?php echo esc_attr( charitable_get_button_class( 'donate' ) ); ?>" |
| 28 |
href="<?php echo charitable_get_permalink( 'campaign_donation_page', array( 'campaign_id' => $campaign->ID ) ); ?>" |
| 29 |
aria-label="<?php echo esc_attr( sprintf( _x( 'Make a donation to %s', 'make a donation to campaign', 'charitable' ), get_the_title( $campaign->ID ) ) ); ?>" |
| 30 |
> |
| 31 |
<?php _e( 'Donate', 'charitable' ); ?> |
| 32 |
</a> |
| 33 |
</div> |
| 34 |
|