gpi_field_inventory

  1. Description
  2. Usage
  3. Parameters
  4. Since

Description

Filter a field’s available inventory. Fields without inventory tracking enabled are passed as null; return an integer to provide their inventory.

Usage

Applied globally

add_filter( 'gpi_field_inventory', 'my_custom_function' );

Applied to specific form

add_filter( 'gpi_field_inventory_FORMID', 'my_custom_function' );

Applied to specific field

add_filter( 'gpi_field_inventory_FORMID_FIELDID', 'my_custom_function' );

Parameters

$available int|null

The available inventory for the field or null if the field does not have inventory tracking enabled.

$field GF_Field

The field the inventory is being retrieved for.

Since

  • 1.0.28 Hook added.