Skip to main content

Actions


kudos_donations_upgraded​

Triggered when the plugin is upgraded.

functions.php
function kudos_on_upgrade( string $plugin ) {
// Your custom code here.
}
add_action( 'kudos_donations_upgraded', 'kudos_on_upgrade' );

kudos_submit_payment​

This action occurs immediately after a payment has been submitted. This action gives you access to the form data submitted.

functions.php
function kudos_on_payment_submit( array $args ) {
// Your custom code here.
}
add_action( 'kudos_submit_payment', 'kudos_on_payment_submit' );

kudos_mailer_send​

This action is triggered whenever an email is sent by the plugin.

functions.php
function kudos_on_email_send( string $to, string $subject, string $body, array $attachment ) {
// Your custom code here.
}
add_action( 'kudos_mailer_send', 'kudos_on_email_send', 10, 4 );

kudos_${vendor_name}_webhook_requested​

Triggered when the webhook for a payment provider is requested. $vendor_name is the provider's slug: mollie or stripe. Gives access to the WP_REST_Request object.

functions.php
function kudos_on_webhook_request( \WP_REST_Request $request ) {
// Your custom code here.
}
add_action( 'kudos_mollie_webhook_requested', 'kudos_on_webhook_request' );

kudos_transaction_${payment_status}​

Triggered whenever the payment status for a transaction changes to the specified status. $payment_status is the new status, such as paid, failed, cancelled or expired; the example below handles paid. The second parameter is the payment provider's slug (mollie or stripe).

functions.php
function kudos_on_transaction_paid( int $transaction_id, string $vendor ) {
// Your custom code here.
}
add_action( 'kudos_transaction_paid', 'kudos_on_transaction_paid', 10, 2 );

kudos_transaction_refunded​

Triggered when the payment provider reports that a transaction has been refunded. The second parameter is the payment provider's slug.

functions.php
function kudos_on_transaction_refunded( int $transaction_id, string $vendor ) {
// Your custom code here.
}
add_action( 'kudos_transaction_refunded', 'kudos_on_transaction_refunded', 10, 2 );

kudos_subscription_created​

Triggered when a donor's first recurring payment has succeeded and their subscription has been created.

functions.php
function kudos_on_subscription_created( int $subscription_id, ?int $donor_id ) {
// Your custom code here.
}
add_action( 'kudos_subscription_created', 'kudos_on_subscription_created', 10, 2 );

kudos_subscription_cancelled​

Triggered when a subscription is cancelled, whether by the donor (using the link in their receipt), by you in the admin, or at the payment provider.

functions.php
function kudos_on_subscription_cancelled( int $subscription_id, ?int $donor_id ) {
// Your custom code here.
}
add_action( 'kudos_subscription_cancelled', 'kudos_on_subscription_cancelled', 10, 2 );

Advanced use only​

warning

These actions are not intended for external use and we do not currently support using them.

kudos_container_ready​

This action is triggered when the container is ready.

kudos_donations_loaded​

This action is triggered when all services are ready.

kudos_donations_activated​

This action is triggered when the plugin is activated.

kudos_donations_deactivated​

This action is triggered when the plugin is de-activated.

kudos_licence_activated​

This action is triggered when a Kudos Donations Plus licence key has been activated.

kudos_clear_all_cache​

This action is triggered when the plugin's caches are cleared with the Clear all cache button on the Kudos Debug page.