Skip to content

Commit 28a5779

Browse files
committed
gppa-acf-repeater-mapper.php: Add support for custom values with ACF field property template.
1 parent bf8be1f commit 28a5779

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gp-populate-anything/gppa-acf-repeater-mapper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
return $choices;
3333
}
3434

35-
$map = array();
35+
$map = array();
3636
$custom_map = array();
3737

3838
foreach ( $field->{'gppa-choices-templates'} as $template => $key ) {
@@ -44,7 +44,7 @@
4444
*/
4545
if ( preg_match( '/meta_([^0-9]+)_([0-9]+)_(.+)/', $key, $matches ) ) {
4646
list( , $repeater, $index, $subfield ) = $matches;
47-
$map[ $template ] = $subfield;
47+
$map[ $template ] = $subfield;
4848
} else {
4949
$custom_map[ $template ] = $key;
5050
}
@@ -68,13 +68,13 @@
6868
if ( $rows ) {
6969
foreach ( $rows as $row ) {
7070
$label = isset( $map['label'] ) ?
71-
apply_filters( 'gppa_acfrm_label', rgar($row, $map['label']), $row, $map['label'] ) :
71+
apply_filters( 'gppa_acfrm_label', rgar( $row, $map['label'] ), $row, $map['label'] ) :
7272
str_replace( 'gf_custom:', '', $custom_map['label'] );
7373

7474
$value = isset( $map['value'] ) ?
75-
apply_filters( 'gppa_acfrm_value', rgar( $row, $map['value']), $row, $map['value'] ) :
75+
apply_filters( 'gppa_acfrm_value', rgar( $row, $map['value'] ), $row, $map['value'] ) :
7676
str_replace( 'gf_custom:', '', $custom_map['value'] );
77-
77+
7878
$choice = array(
7979
'value' => $value,
8080
'text' => $label,

0 commit comments

Comments
 (0)