Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matadorjobs/64e900f9ad0e99ee85d9817250f724c6 to your computer and use it in GitHub Desktop.
Save matadorjobs/64e900f9ad0e99ee85d9817250f724c6 to your computer and use it in GitHub Desktop.
Matador Docs Example: Import Additional (custom) Fields to Your Job
<?php
/**
* Example: Import Additional Job Fields from Bullhorn
*
* Example below imports Bullhorn field named 'customText4', calls it 'salary_range', declares it a 'string', and saves it as
* Job Meta for use in the front-end of the website, presumably to replace the 'salary' with a more descriptive range stat.
*
* @since 2019-07-19
* @updated 2022-05-10
*
* @copyright 2019-2022, Matador Software, LLC
* @author Jeremy Scott, Matador Software LLC
* @link https://matadorjobs.com/
*
* @param $fields
*
* @return array
*/
function mdocs_example_matador_bullhorn_import_fields( $fields ) {
$field_to_add = [
'customText4' => [ // Name of field per Bullhorn Field Mappings (not its label)
'name' => 'salary_range', // Set name for meta when 'saveas' is 'meta'.
'type' => 'string', // Specify type for sanitization, default 'type'.
// Options are 'array', 'object', 'string', and 'time' or 'timestamp'
// Use 'time' or 'timestamp' only if Bullhorn field is type Timestamp
'saveas' => 'meta', // Options are 'core', 'meta', 'custom'. Default 'custom'
],
];
return array_merge( $fields, $field_to_add );
}
add_filter( 'matador_bullhorn_import_fields', 'mdocs_example_matador_bullhorn_import_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment