The gform_product_quantity filter allows you to change the sub-label for the Product Quantity input in Gravity Forms.
Usage
A generic example of how to use the filter:
add_filter('gform_product_quantity', 'set_quantity_label', 10, 2);
To target a specific form, add the form ID after the hook name:
add_filter('gform_product_quantity_6', 'set_quantity_label', 10, 2);
Parameters
- $sublabel (string): The sub-label to be filtered.
- $form_id (integer): ID of the current form.
More information
See Gravity Forms Docs: gform_product_quantity
Examples
Change the quantity sub-label to “How many:”
This example changes the quantity sub-label to “How many:”.
add_filter('gform_product_quantity_185', 'set_quantity_label', 10, 2); function set_quantity_label($sublabel, $form_id) { return 'How many:'; }
Note: Place this code in the functions.php
file of your active theme.