01/25/2019 at 4:03 pm
#482669
Participant
I got this error…. Your PHP code changes were rolled back due to an error on line 117 of file wp-content/themes/divi-child/functions.php. Please fix and try saving again.
syntax error, unexpected ‘cnEntry_Action’ (T_STRING)
this is my code…
// Register the custom fields CSV Import mapping options and processing callback.
add_filter( 'cncsv_map_import_fields', 'cncsv_header_name' );
add_action( 'cncsv_import_fields', 'cncsv_process_import', 10, 3 );
function cncsv_header_name( $fields ) {
// The field_id should match exactly the field id used when registering the custom field.
$fields['Branch Logo'] = 'Branch Logo';
$fields['Marker Location'] = 'Marker Location';
return $fields;
}
function cncsv_process_import( $id, $row, $entry ) {
// The field_id should match exactly the field id used when registering the custom field.
$data = $entry->arrayPull( $row, 'field_id', '' );
$data = cnFormatting::maybeJSONdecode( stripslashes( $data ) )
cnEntry_Action::meta(
'update',
$id,
array(
array(
'key' => 'Branch Logo', // The field_id should match exactly the field id used when registering the custom field.
'value' => $data
),
)
);
cnEntry_Action::meta(
'update',
$id,
array(
array(
'key' => 'Marker Location', // The field_id should match exactly the field id used when registering the custom field.
'value' => $data
),
)
);
}