Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Use this hook to filter the Repeater child entry data before creating.
Usage
add_filter('frm_acf_repeater_child_entry_data','acf_change_ip_child_entry',10, 2);
Parameters
- $entry_data (array): Entry data.
- $args (array): This contains:
- parent_entry (object): Parent entry object.
- child_field (object): Child field object.
- child_value (mixed): The value of child field.
Examples
Change the IP address of child entry
add_filter('frm_acf_repeater_child_entry_data','acf_change_ip_child_entry', 10, 2);
function acf_change_ip_child_entry( $entry_data, $args ) {
if ( 10 == $args['parent_entry']->id ) {
$entry_data['ip'] = '127.0.0.1';
}
return $entry_data;
}