1. Home
  2. Matador Extensions
  3. Recruiter Profiles
  4. Using a Custom Field to Store Recruiters
  1. Home
  2. Matador Extensions
  3. Using a Custom Field to Store Recruiters

Using a Custom Field to Store Recruiters

Matador Jobs Recruiter Profiles extension offers three default fields to link recruiters to jobs: owner, assignedUsers and responseUser. These should be perfectly fine for the majority of users, however if you happen to have a non-standard set up and are using a different field the following information is for you!

The first thing to note, is how a link is made between recruiters and jobs: the recruiter’s email address is stored in a job’s meta, as part of the information contained in the owner, assignedUsers and/or responseUser fields (this will depend on which of these fields you are using). The recruiters email address is also stored as part of each recruiter’s meta. The matching of recruiter’s email addresses to those stored in the linked recruiter type field on jobs is how the association is made between the two.

The consequence of this is that the custom field you are using to store recruiters must contain the recruiters email address.

With that caveat out of the way, it’s time to outline the two steps needed to integrate a custom linked recruiter type field: importing the field for your jobs and adding the field to the available linked recruiter types in the Recruiter Profiles extension.

Importing Custom Job Fields

Fortunately, we have the Job Object Customizer extension to facilitate importing additional job fields. So the first step here is to go install and set up this extension to import your custom field. See our guide on this here.

Add Your Custom Field to the Linked Recruiter Types

Now that the field is imported into each job’s details, the next step is to set the Recruiter Profiles extension to use this field to link recruiters. The extension’s Linked Recruiter Type setting is used to determine which elements of the job meta are queried when matching recruiters to specific jobs. By passing your custom field to this setting, and configuring the setting to use the field, you can get the extension to use your custom field to match jobs and recruiters.

To have your custom field included in the list of available Linked Recruiter Types, you will need to use the ‘matador_extension_recruiters_linked_recruiter_types’ filter:

/**
* Modify the available linked recruiter types.
*
* This filter allows the customization of the default recruiter types array. 
* Use this to add any custom fields used to store recruiter emails linked to jobs
*
* @since 1.0.0
*
* @param array 	$default_recruiter_types Array of default recruiter types.
* @return array 	Filtered array of recruiter types.
*/
apply_filters( 'matador_extension_recruiters_linked_recruiter_types', $default_recruiter_types );

An example of using this filter might look like this snippet:

add_filter( 'matador_extension_recruiters_linked_recruiter_types', 'add_custom_recruiter_field' );
function add_custom_recruiter_field( $default_recruiter_types ) {

    $modified_recruiter_types = $default_recruiter_types;

    $modified_recruiter_types['custom_field'] = esc_html__( 'Your Custom Field Description', 'textdomain' );
    
    return $modified_recruiter_types;
}

Once you’ve added your filter, you should see your custom field appearing in the Recruiter Profiles extension settings.

Check the box for your custom field and save the settings. The extension will now use that field to associate jobs and recruiters.

Updated on January 10, 2024
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support