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 change_font_to_Roboto() { | |
wp_add_inline_style( | |
/** | |
* Below, use give-sequoia-template-css to style the multi-step donation form | |
* or use give-donor-dashboards-app to style the donor dashboard | |
*/ | |
'give-sequoia-template-css', | |
' | |
@import url("https://fonts.googleapis.com/css?family=Roboto"); |
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 custom_pdf_tag_donor_title( $template_content, $args ) { | |
$donor_title = isset( $args['buyer_info']['title'] ) && $args['buyer_info']['title'] !== '' ? $args['buyer_info']['title'] : __('', 'give'); | |
$template_content = str_replace( '{donor_title}', $donor_title, $template_content ); | |
return $template_content; | |
} | |
add_filter( 'give_pdf_compiled_template_content', 'custom_pdf_tag_donor_title', 999, 2 ); |
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 givewp_hide_gift_aid_warnings($notice_args) { | |
if( $notice_args['id'] == 'gift-aid-currency-notice' || $notice_args['id'] == 'gift-aid-country-notice' ) { | |
$notice_args['show'] = false; | |
} | |
return $notice_args; | |
} | |
add_filter( 'give_register_notice_args', 'givewp_hide_gift_aid_warnings' ); |
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_action('give_new_receipt', function($receipt) { | |
$receipt->message = "<a href=\"https://google.com\" target=\"_blank\">This is my custom message for all my forms</a>"; | |
}); |
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 | |
// Make sure to use the legacy donation form to visualize the data | |
function stripe_custom_description($data) { | |
$posted_data = give_clean( filter_input_array( INPUT_POST ) ); | |
print_r($posted_data); | |
die; | |
return 'My custom description here, ' . $data . ' ' . $posted_data; | |
} |
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 custom_pdf_receipt_last_name( $template_content, $args ) { | |
$donor_last_name = isset( $args['payment_meta']['user_info']['last_name'] ) && $args['payment_meta']['user_info']['last_name'] !== '' ? $args['payment_meta']['user_info']['last_name'] : __('Not found', 'give'); | |
$template_content = str_replace( '{donor_last_name}', $donor_last_name, $template_content ); | |
return $template_content; | |
} | |
add_filter( 'give_pdf_compiled_template_content', 'custom_pdf_receipt_last_name', 999, 2 ); |
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 give_add_gift_aid_status_pdf_tag( $template_content, $args ) { | |
// during testing, uncomment the next line to see a full printed array of the possible args that you can query | |
// var_dump("<pre>".print_r($args,true)."</pre>"); | |
$gift_aid_status = isset( $args['payment_meta']['_give_gift_aid_accept_term_condition'] ) && $args['payment_meta']['_give_gift_aid_accept_term_condition'] == 'on' ? 'Yes' : 'No'; | |
$template_content = str_replace( '{gift_aid_status}', $gift_aid_status, $template_content ); | |
return $template_content; | |
} |
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
#!/usr/bin/env bash | |
wp give ascii | |
wp give details | |
wp give forms --id=103 | |
wp plugin install give --activate | |
wp give test-donation-form --count=10 --template=random --set-goal=true --set-terms=true | |
wp give test-donors --count=100 | |
wp give test-donations --count=500 --status=random --total-revenue=100000 --start-date=2020-11-22 --params=donation_currency=USD |
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
/** | |
* TESTING: Outputs all post meta | |
* | |
* This section outputs all the custom fields for your reference | |
* Just set the $testing variable to true | |
*/ | |
$testing = true; | |
if ( $testing == true ) { |
NewerOlder