gplc_out_of_stock_message
Description
Filter validation message when the item is out of stock.
Usage
Apply to all forms.
add_filter( 'gplc_out_of_stock_message', 'my_custom_function' );
Apply to a specific form.
add_filter( 'gplc_out_of_stock_message_FORMID', 'my_custom_function' );
Apply to a specific field on a specific form.
add_filter( 'gplc_out_of_stock_message_FORMID_FIELDID', 'my_custom_function' );
Parameters
out_of_stock_message string
Validation message.
form array
Form Object
field array
Field Object
inventory_data array
Includes the limit, count, requested count and remaining count.
Examples
<?php
/**
* Gravity Perks // Limit Choices // Customize Out of Stock Validation Message
* https://gravitywiz.com/documentation/gravity-forms-limit-choices/
*/
add_filter( 'gplc_out_of_stock_message', function( $out_of_stock_message, $form, $field, $inventory_data ) {
return 'Sorry, friends. This item is no longer available.';
}, 10, 4 );
Since
This filter is available since GF Limit Choices 1.6.