This guide will show you how to add custom application fields to your form, and then consolidate the responses to these fields into a Note in Bullhorn.
We’re going to build a simple WordPress plugin that:
- Adds new fields to the application form.
- Saves the field values into the application data.
- Syncs that data to Bullhorn as a candidate Note.
Some things you’ll need:
- A WordPress site with Matador Jobs Pro installed and active.
- Admin access to install and activate custom plugins.
- Basic familiarity with PHP and WordPress plugin development.
Step 1: Create the plugin
Create a new folder in your plugins directory, and within that folder add a plugin file:
wp-content/plugins/matador-custom-note/matador-custom-note.phpThen inside that folder paste the following example code:
<?php
/**
* Plugin Name: Matador Custom Note Plugin
* Description: Add a custom application field, have its value saved as a note in Bullhorn.
* Version: 1.0.0
* Author: Matador Jobs
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class MatadorCustomFieldToNote {
function __construct() {
add_filter( 'matador_application_fields', [ $this, 'add_custom_fields' ], 10 );
add_action( 'matador_application_data_processed', [ $this, 'save_custom_fields_to_note' ], 10, 2 );
add_action( 'matador_bullhorn_candidate', [ $this, 'create_note_from_custom_questions' ], 10, 5 );
}
/**
* Add custom fields to the application form.
*/
function add_custom_fields( $fields ) {
$fields['custom_question_1'] = [
'label' => __( 'Are these the droids you are looking for?', 'matador-custom-field-to-note' ),
'type' => 'radio',
'required' => true,
'options' => [
'Yes' => __( 'Yes', 'matador-custom-field-to-note' ),
'No' => __( 'No', 'matador-custom-field-to-note' ),
],
];
$fields['custom_question_2'] = [
'type' => 'checkbox',
'label' => null,
'options' => [
'1' => esc_html__( 'Are you not entertained?', 'matador-custom-field-to-note' ),
],
'description' => 'description',
'attributes' => [
'required' => 'required',
'data-msg-required' => __( 'Maximus requires an answer', 'matador-custom-field-to-note' ),
'minlength' => 1,
],
];
$fields['custom_question_3'] = [
'type' => 'select',
'label' => esc_html__( 'Who you gonna call?', 'matador-custom-field-to-note' ),
'default' => '',
'options' => [
'' => esc_html__( 'Please select an option', 'matador-custom-field-to-note' ),
'ghostbusters' => esc_html__( 'Ghostbusters', 'matador-custom-field-to-note' ),
'other' => esc_html__( 'Someone else', 'matador-custom-field-to-note' ),
],
];
return $fields;
}
/**
* Collect custom field responses and save to the application.
*/
function save_custom_fields_to_note( $application, $request ) {
if ( empty( $request['custom_question_1'] ) ) {
return $application;
}
$note = 'The response to question 1 is: ' . sanitize_text_field( $request['custom_question_1'] ) . "\n";
$note .= 'The response to question 2 is: ' . sanitize_text_field( $request['custom_question_2'] ) . "\n";
$note .= 'The response to question 3 is: ' . sanitize_text_field( $request['custom_question_3'] );
$application['application']['custom_note'] = $note;
return $application;
}
/**
* Create a Bullhorn Note during candidate sync.
*/
function create_note_from_custom_questions( $application_id, $application_data, $candidate_data, $candidate_resume, $bullhorn ) {
$note = $application_data['custom_note'] ?? 'Failed to find custom note text';
$body = [
'personReference' => [ 'id' => $candidate_data->candidate->id ],
'comments' => $note,
'action' => 'Other',
];
$response = $bullhorn->request( 'entity/Note', [], 'PUT', $body );
}
}
if ( is_plugin_active( 'matador-jobs-pro/matador.php' ) ) {
new MatadorCustomFieldToNote();
}
Step 2: Activate the Plugin
- In your WordPress dashboard, go to Plugins → Installed Plugins.
- Activate Matador Custom Note Plugin.
Your application form will now include the three extra questions added in the MatadorCustomFieldToNote class’s add_custom_fields method.
Step 3: Submit an Application
When a candidate applies:
- Their responses are collected.
- A note string is generated.
- That note is synced to Bullhorn and attached to the candidate.
Submit a test application to confirm all this is working as it should, and you’re seeing the note created in Bullhorn.
Step 4: Adjust the Code & Final Testing
Once you’ve tested the example code above is all working, adjust it to your needs:
- You can add any number of custom fields in the
add_custom_fields()method. - Adjust the text formatting in
save_custom_fields_to_note()to match your reporting needs.
Run some final tests to make sure your modifications work they way you want them to.