Skip to main content

Filters


info

The kudos_payment_description and kudos_frequency_options filters no longer exist. Payments are now described with the transaction's title, and the frequency options for recurring donations are a setting of each campaign, provided by Kudos Donations Plus.

kudos_receipt_attachment​

Used to modify or add attachments to receipt emails.

functions.php
function kudos_filter_attachments( array $attachments, int $transaction_id ) {
$attachments[] = '/path/to/attachment.pdf';
return $attachments;
}
add_filter( 'kudos_receipt_attachment', 'kudos_filter_attachments', 10, 2 );

kudos_invoice_company_name​

Change the company/website name displayed on the footer of the invoice and email receipt. Defaults to get_bloginfo( 'name' ).

functions.php
function kudos_filter_company_name( string $name ) {
return 'My Charity Name';
}
add_filter( 'kudos_invoice_company_name', 'kudos_filter_company_name' );

Change the logo shown on receipt emails and PDF receipts. Receives the URL of the current logo and should return the URL of the image to use. (Kudos Donations Plus uses this filter for its custom logo setting.)

functions.php
function kudos_filter_logo( string $logo ) {
return 'https://example.org/wp-content/uploads/logo.png';
}
add_filter( 'kudos_company_logo', 'kudos_filter_logo' );

kudos_cancel_subscription_url​

Change the page that the cancel subscription link in a recurring donation receipt points to. Defaults to your home page; the link's parameters are added to the URL you return.

functions.php
function kudos_filter_cancel_url( string $url ) {
return home_url( '/manage-my-donation/' );
}
add_filter( 'kudos_cancel_subscription_url', 'kudos_filter_cancel_url' );

kudos_rest_fields_${entity}​

Change or add fields in the REST API responses for campaigns, transactions, donors and subscriptions. $entity is campaign, transaction, donor or subscription. Receives the prepared fields as an array and the entity object.

functions.php
function kudos_filter_transaction_fields( array $fields, $transaction ) {
$fields['my_field'] = 'My value';
return $fields;
}
add_filter( 'kudos_rest_fields_transaction', 'kudos_filter_transaction_fields', 10, 2 );