Skip to content

Commit cb06fa4

Browse files
authored
gpi-populate-days.php: Fixed an issue where available inventory only displayed when previewing the form.
1 parent dfbe80a commit cb06fa4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

gp-inventory/gpi-populate-days.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@
1818
*
1919
* 2. Follow the inline instructions to configure the snippet for your form.
2020
*/
21-
// Change `123` to your form ID
22-
add_filter( 'gform_pre_render_123', 'gw_populate_days_into_radio', 5, 1 );
23-
add_filter( 'gform_pre_validation_123', 'gw_populate_days_into_radio', 5, 1 );
21+
add_filter( 'gform_pre_render', 'gw_populate_days_into_radio', 5, 1 );
22+
add_filter( 'gform_pre_validation', 'gw_populate_days_into_radio', 5, 1 );
2423
function gw_populate_days_into_radio( $form ) {
2524

25+
// Change `123` to your form ID
26+
if ( (int) rgar( $form, 'id' ) !== 123 ) {
27+
return $form;
28+
}
29+
2630
// Update `1` with your Radio Button field ID
2731
$field_id = 1;
2832

0 commit comments

Comments
 (0)