Override the donation mailing-list opt-in checkbox label
Replaces the default mailing-list opt-in checkbox text on the donation form with a custom label — useful for localisation or to set clearer send-frequency expectations.
The filter receives the default label, the show’s post ID, and the show title so you can include dynamic copy. Add a translators comment when wrapping the string with __() so translation tooling can extract it correctly.
One callback covers every donation surface. The filter labels all three widget styles on the page (the inline form’s checkbox, and the label the button and icon modals read), and the same label is returned as enrollment_label by GET /benecaster/v1/shows/{id}/listener-support/config, for anything building its own form. Both pass the same arguments.
$show_title is plain text (Dave’s Q&A, not Dave’s Q&A), and so is the label you return. Benecaster escapes it where it prints it, so don’t escape it yourself; do escape it if you print it into HTML anywhere else.
Code
<?php
add_filter(
'benecaster_donor_enrollment_label',
function ( string $default_label, int $show_id, string $show_title ): string {
return sprintf(
/* translators: %s: podcast show title */
__( 'Yes! Send me updates from %s (~1 email per month, unsubscribe anytime).', 'my-addon' ),
$show_title
);
},
10,
3
);
Hooks Used
Need this built rather than just documented? See our services →