Here how to do it :
(https://docs.gravityforms.com/gform_advancedpostcreation_post_after_creation/)
The scope of this example is limited to form id 1 and field id 18, you need to update these values to apply to your own form and field.
Replace my_custom_field_key with your custom field meta key
add_filter( 'gform_advancedpostcreation_post_after_creation_1', 'apc_serialize_checkboxes', 10, 4 );
function apc_serialize_checkboxes( $post_id, $feed, $entry, $form ) {
// Checkboxes field id.
$field_id = 18;
// Get field object.
$field = GFAPI::get_field( $form, $field_id );
if ( $field->type == 'checkbox' ) {
// Get a comma separated list of checkboxes checked
$checked = $field->get_value_export( $entry );
// Convert to array.
$values = explode( ', ', $checked );
}
// Replace my_custom_field_key with your custom field meta key.
update_post_meta( $post_id, 'my_custom_field_key', $values );
}
Hi! I’m looking for the same thing.
Hi,
I’m looking for the same thing. Did you find a solution?
Got it guys.
Here’s for a flexible field on
ACF Pro 5.3.2.2
add_action('acf/input/admin_head', 'my_acf_admin_head');
function my_acf_admin_head() {
?>
<script type="text/javascript">
(function($) {
acf.add_action('ready', function(){
$('body').on('click', 'li.acf-fc-show-on-hover a.acf-icon.-minus.small', function( e ){
return confirm("Do you really want to delete this?");
});
});
})(jQuery);
</script>
<?php
}
Tx. That’s what I tought. I use to have the blank page error because of my syntax. You cannot copy/paste this directly 😉
Now I would like to do the same but with a flxiebl field.
any ideas ?
Cheers.
Hi Guys,
This seems very useful.
To we have to add this code to the function.php?
Regards,
Franck
Tx,
I’ll check this.
Regards,
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.