WP Simple Pay Documentation

Documentation, Reference Materials, and Tutorials for WP Simple Pay

simpay_recurring_description_format

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

  1. $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”
  2. $form_id (int) — The payment form post ID. 0 if 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.

Still have questions? We're here to help!

Last Modified:

Start Accepting Payments Today

Start accepting one-time and recurring payments or donations on your WordPress website.