Skip to main content

benecaster_donation_minimum_amount

Filter Free

Filters the minimum a donor’s TYPED amount must clear, per show, at read time. The saved value is an operator setting — Settings → Listener Support → Donation amounts, with a per-show override — and this filter overrides it without touching what is stored.

This is the supported way to enforce a donation floor. A refusal below it returns benecaster_amount_below_minimum (HTTP 400) with minimum_custom_amount in the error data, so a custom donation form can tell the supporter what would work. Filtering the amount instead silently changes what they are charged.

The floor never applies to the show’s own suggested amounts, and this filter cannot make it. Benecaster checks the suggested list first, deliberately: a floor that could veto a suggested amount would disable a button the podcaster can see on their own page, with the explanation nowhere. To remove a suggested amount, use benecaster_donation_suggested_amounts — that is the filter that owns the buttons.

Minor units, and minor units are not always hundredths. 500 is $5.00 in USD and ¥500 in JPY. Read the currency from the settings array rather than dividing by 100.

A zero amount, or any amount on a show that takes no custom amounts at all, returns the generic benecaster_invalid_amount rather than benecaster_amount_below_minimum. Do not treat the two as one, or you will tell a donor to try a bigger number on a show where no number can succeed.

Parameters

Name Type Default Description
$minimum int — The floor in MINOR units. Default 100.
$show_id int — ID of the show

Returns: int

Example

/**
 * A patronage show wants a $25 floor; everything else keeps the site value.
 */
add_filter( 'benecaster_donation_minimum_amount', function( $minimum, $show_id ) {
    return 42 === (int) $show_id ? 2500 : $minimum;
}, 10, 2 );

Need this built rather than just documented? See our services →