simpay_recurring_description_format
In This Document
Type: Filter | Since: 4.17.1
Description
The simpay_recurring_description_format filter allows you to programmatically override the installment description format key used for a specific payment form. This filter runs after the global and per-form settings have been resolved, giving you final control over which format is applied.
Arguments
$format_key(string) — The resolved format key. One of:count_adj_amount— “12 monthly payments of $24” (default)amount_per— “$24 per month for 12 payments”amount_every— “$24 every month, 12 payments total”
$form_id(int) — The payment form post ID.0if no form context is available.
Example
The following example forces a specific form (ID 150) to always use the “amount per interval” format, regardless of the global or per-form setting:
add_filter( 'simpay_recurring_description_format', function ( $format_key, $form_id ) {
if ( 150 === $form_id ) {
return 'amount_per';
}
return $format_key;
}, 10, 2 );
You can safely add this code using the WPCode plugin. Always test custom code on a staging site before deploying to production.
Changelog
| Version | Description |
|---|---|
| 4.17.1 | Introduced. |
Related
- How to Customize Installment Description Formats – Configure formats via the admin UI
- Installment Plans – Set up installment payment plans
- Adding Custom Code – How to add custom PHP code to your site
Still have questions? We're here to help!
Last Modified: