Closed tyrann0us closed 6 years ago
I think that would work! I implemented your suggested changes with commit e30e128e95d622c33ea42b46d624c28b30d3de1e.
Thanks a lot!
Hi,
I think there is a problem when you have a group that owns another group.
Example :
1 ACF :
who has a acf dog (see 2 ACF)
2 ACF :
Who has a acf owner (see 3 ACF)
3 ACF :
If i do :
af_get_field("civilite")
=> Return false
When i see the data :
We do not go through the group
to correct I add:
if ( $sub_field_name == $field_key_or_name ) { return $sub_field_value; }elseif( $sub_field_name == 'groupe'){ foreach ($sub_field_value as $sub_field_name_2 => $sub_field_value_2) { if ( $sub_field_name_2 == $field_key_or_name ) { return $sub_field_value_2; } } }
for the future it would not be judicious to use the indentifiants and not the names like key?
Hi @Fabianlindfors, thank you for this great plugin!
I noticed that
af_get_field
won't work if the field type is set to "Group". Example: Field of type "Group" called "field" has a sub field called "sub_field". How am I supposed to access the sub field?af_get_field( 'field[sub_field]' )
does not work, neither doesaf_get_field( 'sub_field' )
.https://github.com/advancedforms/advanced-forms/blob/12e950b93c2969f71480af4488cc93ffd7bc1b6f/api/api-forms.php#L55-L56
If I change the condition to
if ( isset( $field['sub_fields'] ) ) {
thenaf_get_field( 'sub_field)
works.Would it be safe to change the condition as mentioned? Thanks!