Last active
May 11, 2022 05:49
-
-
Save matadorjobs/64e900f9ad0e99ee85d9817250f724c6 to your computer and use it in GitHub Desktop.
Matador Docs Example: Import Additional (custom) Fields to Your Job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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