wpnzach
10/17/2014 - 6:53 PM

checkboxvaluecsv.php

<?php
 
function nf_change_user_csv_value( $user_value , $field_id ) {
	// Grab the field.
	$field = ninja_forms_get_field_by_id( $field_id );
	// Check if this is a checkbox.
	if ( $field['type'] == '_checkbox') { // If this is a checkbox, change the value
		// checking value of user value, assigning new value
		if ( $user_value == 'checked' ) {
			$user_value = 1;
		} else {
			$user_value = 0;
		}
	}
	return $user_value;
}
add_filter( 'nf_subs_csv_field_value', 'nf_change_user_csv_value' , 10, 2 );