This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adjust the before/after variables to limit the deletion to | |
* a specific date range. If you want to delete all, set a very | |
* early $before date (i.e. '2000-01-01'). | |
*/ | |
add_action( 'admin_init', function() { | |
$after = '2020-11-01'; | |
$before = '2020-11-30'; | |
$query = new Charitable_Donations_Query( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'charitable_newsletter_connect_provider_donation_fields', | |
function( $fields ) { | |
$fields['donation_gateway'] = 'Payment Gateway'; | |
return $fields; | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.custom-donation-amount-wrapper::before { | |
content: "$"; | |
display: block; | |
position: absolute; | |
bottom: .5em; | |
left: 1em; | |
color: #bbb; | |
padding: 6px 0 6px 7px; | |
font-size: 1em; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ed_charitable_set_paypal_item_name( $args, $donation_id, $processor ) { | |
$donation = charitable_get_donation( $donation_id ); | |
$campaign_id = current( $donation->get_campaign_donations() )->campaign_id; | |
$parent_id = wp_get_post_parent_id( $campaign_id ); | |
$parent_title = get_the_title( $parent_id ); | |
$paypaldescript = 'LETRGive - ' . $parent_title . ' - #106' . $donation_id; | |
$args['item_name'] = $paypaldescript; | |
return $args; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function adds a custom text field to the campaign submission | |
* form, as well as the admin campaign editor, campaign emails, and | |
* campaign export. | |
* | |
* Note: This example requires Ambassadors 2+. For an example that worked | |
* on previous version, see the link below. | |
* | |
* @see https://github.com/Charitable/library/blob/master/extensions/ambassadors/legacy/add-text-field.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function adds a custom text field to the campaign submission | |
* form, as well as the admin campaign editor, campaign emails, and | |
* campaign export. | |
* | |
* Note: This example requires Ambassadors 2+. For an example that worked | |
* on previous version, see the link below. | |
* | |
* @see https://github.com/Charitable/library/blob/master/extensions/ambassadors/legacy/add-text-field.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* If the original recurring donation opted in to Gift Aid, apply Gift Aid for | |
* all renewals too. | |
* | |
* @param array $args Array of arguments to create donation. | |
* @return array | |
*/ | |
function ed_charitable_apply_gift_aid_to_renewals( $args ) { | |
// Make sure this is a renewal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fields_api->register_field( | |
new Charitable_Campaign_Field( | |
'attendees', | |
[ | |
'label' => 'Attendees', | |
'data_type' => 'meta', | |
'admin_form' => [ | |
'required' => false, | |
'section' => 'hike-details', |