Map GF Checkbox Field to ACF Checkbox Field (User Meta)

Read the Walkthrough

Code

Filename: gw-checkbox-to-acf.php

<?php
/**
 * Gravity Wiz // Gravity Forms // Map GF Checkbox Field to ACF Checkbox Field (User Meta)
 * http://graivtywiz.com/
 */
add_filter( 'gform_user_registration_meta_value', function( $value, $meta_key ) {
	// Update "checkboxes" to your custom field's name.
	if ( $meta_key === 'checkboxes' ) {
		$value = array_map( 'trim', explode( ',', $value ) );
	}
	return $value;
}, 10, 2 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.