1. Home
  2. Matador Extensions
  3. Discord Notifications
  4. Modify label text in Discord Notifications
  1. Home
  2. Developer
  3. How-To Guides
  4. Modify label text in Discord Notifications
  1. Home
  2. Developer
  3. Modify label text in Discord Notifications
  1. Home
  2. Matador Extensions
  3. Modify label text in Discord Notifications

Modify label text in Discord Notifications

The Matador Jobs Pro – Discord Notifications Extension comes with some sensible defaults for the various context-giving pieces of text included in the message of the notification. E.G. the link to a job’s application form has the text ‘Apply for this Job’ by default.

You may want to modify these default labels, and this can be achieved quite easily with the relevant filter. Here’s an example of modifying the label used for the job description to ‘Summary’:

/**
 * Change the label for the job description field in Discord messages to 'Summary'.
 *
 * @param string $name The original name value, 'Job Description' by default.
 * @param array $job The job object containing details about the job.
 * @param int $wpid The WordPress ID of the job.
 * @return string Modified name value.
 */
function change_discord_job_description_label_to_summary( $name, $job, $wpid ) {
    return __( 'Summary', 'your-text-domain' ); // Replace 'your-text-domain' with your theme's or plugin's text domain.
}

// Add the filter
add_filter( 'discord_jobs_description_label', 'change_discord_job_description_label_to_summary', 10, 3 );

This model can be followed for changing all of the labels within the notifications. Below you will find a table of all the available filters and the labels they are for.

FilterLabel
discord_jobs_category_labelJob Notifications Job Category Label
discord_jobs_type_labelJob Notifications Job Type Label
discord_jobs_location_labelJob Notifications Job Location Label
discord_jobs_description_labelJob Notifications Job Description Label
discord_jobs_details_labelJob Notifications Job Details Label
discord_jobs_bullhorn_link_textJob Notifications Job Bullhorn Link Text
discord_jobs_wordpress_link_textJob Notifications Job WordPress Link Text
discord_jobs_apply_link_textJob Notifications Job Application Link Text
discord_applications_applicant_name_labelApplication Notifications Applicant Name Label
discord_applications_job_labelApplication Notifications Job Applied For Label
discord_applications_bullhorn_link_text_sync_doneApplication Notifications Application Bullhorn Link Text, when notifications are set to trigger after sync with Bullhorn
discord_applications_text_sync_pendingApplication Notifications Text displayed when notifications are set to trigger immediately upon application (before sync with Bullhorn)

All of these filters take a first argument which corresponds to the default label/text, followed by either the application, or job (according to the type of notification) as a second argument, and the WordPress ID of the job or application as the third argument.

Updated on February 23, 2024
Was this article helpful?

Related Articles

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