01/25/2019 at 4:28 pm
#482673
Keymaster
@ Margo
You missing a trailing semicolon on the previous line of 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.
$logo = $entry->arrayPull( $row, 'Branch Logo', '' );
$logo = cnFormatting::maybeJSONdecode( stripslashes( $logo ) );
$marker = $entry->arrayPull( $row, 'Marker Location', '' );
$marker = cnFormatting::maybeJSONdecode( stripslashes( $marker ) );
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' => $logo
),
array(
'key' => 'Marker Location', // The field_id should match exactly the field id used when registering the custom field.
'value' => $marker
),
)
);
}
