gpi_temporary_payment_statuses

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Temporarily counts 'Processing' payment status towards inventory limit for 5 minutes.
  5. Since

Description

Filter payment statuses that should count towards inventory for a limited time after entry creation. Return an associative array where the keys are payment statuses and the values are the number of seconds the reservation should remain in effect.

Usage

Applied globally

add_filter( 'gpi_temporary_payment_statuses', 'my_custom_function' );

Applied to specific form

add_filter( 'gpi_temporary_payment_statuses_FORMID', 'my_custom_function' );

Applied to specific field

add_filter( 'gpi_temporary_payment_statuses_FORMID_FIELDID', 'my_custom_function' );

Parameters

$temporary_statuses array

Associative array of payment statuses => duration in seconds.

$field GF_Field

Field for which inventory is being queried.

Examples

Temporarily counts 'Processing' payment status towards inventory limit for 5 minutes.

add_filter( 'gpi_temporary_payment_statuses', function ( $temporary_statuses, $field ) {
  $temporary_statuses['Processing'] = 5 * MINUTE_IN_SECONDS;
  return $temporary_statuses;
}, 10, 2 );

Since

  • 1.0.18 Hook added.