Skip to content

Commit a51989f

Browse files
authored
gppa-gpeb-force-rehydration-on-edit.php: Fixed issue with rehydration not working when editing entries with GP Entry Blocks.
1 parent 353aeb7 commit a51989f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gp-populate-anything/gppa-gpeb-force-rehydration-on-edit.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
// Update (or remove) "4", "5", and "6" to the field IDs that should be rehydrated.
1717
$field_ids = array( 4, 5, 6 );
1818

19-
if ( ! is_callable( array( 'GP_Populate_Anything', 'populate_field' ) ) || ! isset( $GLOBALS['gppa-field-values'] ) || $entry['form_id'] != $form_id ) {
19+
if ( ! is_callable( array( gp_populate_anything(), 'populate_field' ) ) || ! isset( $GLOBALS['gppa-field-values'] ) || $entry['form_id'] != $form_id ) {
2020
return $entry;
2121
}
2222

2323
$form = GFAPI::get_form( $form_id );
2424
foreach ( $form['fields'] as &$field ) {
2525
if ( in_array( $field->id, $field_ids ) ) {
26-
$hydrated_field = gp_populate_anything()->populate_field( $field, $form, array(), $entry );
26+
$hydrated_field = gp_populate_anything()->populate_field( $field, $form, gp_populate_anything()->get_posted_field_values( $form ), array() );
2727
$entry[ $field->id ] = $hydrated_field['field_value'];
2828
}
2929
}

0 commit comments

Comments
 (0)