gpi_out_of_stock_message

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

Description

Filter validation message when the item is out of stock.

Usage

Apply to all fields on all forms.

add_filter( 'gpi_out_of_stock_message', 'my_custom_function' );

Apply to all fields on a specific form.

add_filter( 'gpi_out_of_stock_message_FORMID', 'my_custom_function' );

Apply to a specific field on a specific form.

add_filter( 'gpi_out_of_stock_message_FORMID_FIELDID', 'my_custom_function' );

Parameters

  • out_of_stock_message string

    Validation message.

  • form array

    The current form.

  • field GF_Field

    The current field.

  • inventory_data array

    Includes the limit, count, requested count, and available count.

Examples

add_filter( 'gpi_out_of_stock_message', function(){
	return 'Sorry, this item is out of stock.';
} );

Since

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