gpi_allow_negative_stock

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Allow negative stock to be applied on all forms.
  5. Since

Description

Filter whether negative stock should be allowed.

Usage

Apply to all fields on all forms.

add_filter( 'gpi_allow_negative_stock', 'my_custom_function' );

Apply to all fields on a specific form.

add_filter( 'gpi_allow_negative_stock_FORMID', 'my_custom_function' );

Apply to a specific field on a specific form.

add_filter( 'gpi_allow_negative_stock_FORMID_FIELDID', 'my_custom_function' );

Parameters

true to allow negative stock.

The current field.

The current form.

Examples

Allow negative stock to be applied on all forms.

add_filter( 'gpi_allow_negative_stock', '__return_true' );

Since

This filter is available since Gravity Forms Inventory 1.0-beta-3.40.