Skip to content

Commit 2e651e4

Browse files
committed
Update gw-list-field-as-choices-usage.php
1 parent fe104c1 commit 2e651e4

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

gravity-forms/gw-list-field-as-choices-usage.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,18 @@
3535
'value_template' => '{Name}',
3636
) );
3737

38+
# Filter Usage
3839

39-
/** Usage of filters in the snippet */
40-
41-
//Customization values based on a user input step from Gravity Flow - The entry list field has already been populated.
42-
/*
43-
add_filter( 'gplibrary_list_field_choices', 'example_flow_list_choice_populate', 10, 3 );
44-
function example_flow_list_choice_populate( $values, $form, $args) {
40+
## Customize choices to be populated based on Gravity Flow User Input step.
41+
add_filter( 'gwlfac_list_field_choices', function( $values, $form, $args ) {
4542
if ( is_array( $values ) ) {
4643
return $values;
4744
}
4845

49-
//Confirm we are within a Gravity Flow Inbox
50-
if( rgget( 'lid' ) && rgget( 'page') == 'gravityflow-inbox' ) {
51-
$entry = GFAPI::get_entry( (int)rgget('lid') );
52-
//Verify the entry list field has previously stored values to use.
46+
// Confirm we are within a Gravity Flow Inbox.
47+
if ( rgget( 'lid' ) && rgget( 'page') == 'gravityflow-inbox' ) {
48+
$entry = GFAPI::get_entry( (int) rgget( 'lid' ) );
49+
// Verify the entry list field has previously stored values to use.
5350
if ( $entry ) {
5451
$values = unserialize( $entry[ $args['list_field_id'] ] );
5552
if ( ! is_array( $values ) ) {
@@ -60,5 +57,4 @@ function example_flow_list_choice_populate( $values, $form, $args) {
6057
}
6158
}
6259
return false;
63-
}
64-
*/
60+
}, 10, 3 );

0 commit comments

Comments
 (0)