Customization Snippets

Note: All code examples on this site are provided for developer reference/guidance only and we cannot guarantee that they will always work as expected. Our support policy does not include assistance with modifying or debugging code from any code examples, and they may be changed or removed if we find they no longer work due to changes in our plugins.

This page consists of all the customization snippets we have so far. We may occasionally add new ones and we encourage everyone to also send their own snippets to us! If you add a customization that you think will benefit others, get in touch with us via our Support form. The more snippets we put on this page, the more it will be useful for everyone!

Change the From: name in the Job Alert notification

Change the From: email in the Job Alert notification

Remove the “My Packages” section from My Account

Specify language to use for geocoding

Add Underline button to the TinyMCE editor toolbar

Add Job ID to Job Meta

Send email to candidate when resume is approved

Count Bookmarks

Change “Bookmark this Job” to “Save this Job”

Use alternative login page

Redirect when an application is submitted

Redirect when a resume is submitted

Increase HTTP timeout to 30 seconds

Remove “Listing Expires” column from Job Dashboard

Deregister application.js

Change default new role in WooCommerce

Add e-mail setting field to WPJM Resume

Remove the sign-in option from WPJM Resume Submission

Prefill the Locations field for a job posting to a particular town

Prefill the company logo field

Improve WPJM search when using Polylang

Hide ‘hired’ candidates from applications list in Job Dashboard

Add Display Job Categories Shortcode

Add Display Job Categories Shortcode for a single listing

Redirect to Job Dashboard after job submission

Make custom meta field searchable

Change the From: details for the Applications Employer notification

Change the From: details for the Applications Candidate notification

Remove a field from the job submission page

Enable comments on job listings

Change the number of tags displaying in the job listing page

Exclude resume (CV) files in notification emails to employers

Add custom email frequency for WPJM Job Alerts

Remove all company details from the job submission page

Change default job type

Show hidden WooCommerce products when selecting a job package

Add Company Logo to RSS feed

Change the From: name in the Job Alert notification

 function job_manager_alerts_mail_from_name_dm () {
 		return "Add From Name Here";   
 }

add_filter('job_manager_alerts_mail_from_name', 'job_manager_alerts_mail_from_name_dm');

Change the From: email in the Job Alert notification

function job_manager_alerts_new_alert_from_email() {
 $my_new_email = 'test@example.com';
 return $my_new_email;
}

add_filter( 'job_manager_alerts_mail_from_email', 'job_manager_alerts_new_alert_from_email'); 

Remove the “My Packages” section from My Account

add_action( 'plugins_loaded', 'dj_remove_my_jobs', 20 );

function dj_remove_my_jobs() {
	remove_action( 'woocommerce_before_my_account', array( WC_Paid_Listings_Orders::get_instance(), 'my_packages' ) );
}

Specify language to use for geocoding

add_filter( 'job_manager_geolocation_endpoint', 'change_geocode_lang' );
function change_geocode_lang( $endpoint ) {
  // Use language from https://developers.google.com/maps/faq#using-google-maps-apis
  return add_query_arg( 'language', 'en-GB', $endpoint );
}

More about this snippet can be found here.

Add Underline button to the TinyMCE editor toolbar

add_filter( 'submit_job_form_wp_editor_args', 'customize_editor_toolbar' );

function customize_editor_toolbar( $args ) {
	$args['tinymce']['toolbar1'] = 'bold,italic,underline,|,bullist,numlist,|,link,unlink,|,undo,redo';
	return $args;
}

Add Job ID to Job Meta

<li class="job-id"><?php echo "Job ID: " . $post->ID ?></li>

Note: Put this line of code inside the file content-single-job_listing_meta.php.

Send email to candidate when resume is approved

function resume_published_send_email($post_id) {
   $post = get_post($post_id);
   $author = get_userdata($post->post_author);

   $message = "
      Hi ".$author->display_name.",
      Your resume, ".$post->post_title." has just been approved at ".get_permalink( $post_id ).". Well done!
   ";
   wp_mail($author->user_email, "Your resume is online", $message);
}
add_action('publish_resume', 'resume_published_send_email');

Count Bookmarks

<th><?php $count_b = count($bookmarks) - 2; echo $count_b; ?></th>

Add this code to wp-job-manager-bookmarks/templates/my-bookmarks.php to display the number of bookmarks.

Change “Bookmark this Job” to “Save this Job”

add_filter('gettext', 'translate_text');

function translate_text($translated) { 
$translated = str_ireplace('Bookmark This %s', 'Save this Job', $translated); 
return $translated; 
}

Use alternative login page

add_filter( 'login_url', 'my_login_page', 10, 2 );
function my_login_page( $login_url, $redirect ) {
    return home_url( '/my-custom-login-page/?redirect_to=' . $redirect );
}

Redirect when an application is submitted

Redirect when a resume is submitted

Note: This snippet currently breaks the edit functionality. Title and Location edit will not be saved when this snippet is used.

Increase HTTP timeout to 30 seconds

add_filter( 'http_request_timeout', 'wpjm_extend_http_timeout', 99 );
function wpjm_extend_http_timeout( $timeout ) {
	return 30;
}

Remove “Listing Expires” column from Job Dashboard

Deregister application.js

add_action( 'wp_enqueue_scripts', 'remove_application_js' , 11 );
function remove_application_js(){
  wp_deregister_script( 'wp-job-manager-job-application' );
}

Change default new role in WooCommerce

function my_new_customer_data( $new_customer_data ){
    $new_customer_data['role'] = 'candidate';
    return $new_customer_data;
}
add_filter( 'woocommerce_new_customer_data', 'my_new_customer_data');

Add e-mail setting field to WPJM Resume

add_filter('resume_manager_settings', 'bk_add_email_resumes');

function bk_add_email_resumes( $settings ){
  $settings['resume_submission'][1][] = array(
    'name' 		=> 'resume_manager_email_notifications',
    'std' 		=> '',
    'label' 	=> __( 'E-Mail Addresses To Be Notified', 'wp-job-manager-resumes' ),
    'desc'		=> __( 'Instead of the admin, bother these folks instead.', 'wp-job-manager-resumes' ),
    'type'      => 'input'
  );
  return $settings;
}

add_filter( 'resume_manager_new_resume_notification_recipient', 'bk_apply_my_setting' );
function bk_apply_my_setting( $email ){
  $option = get_option('resume_manager_email_notifications');
  if ( $option ) {
    return $option;
    }
  return $email;
}

Remove the sign-in option from WPJM Resume Submission

add_filter( 'submit_resume_form_show_signin', '__return_false' );

Prefill the Locations field for a job posting to a particular town

add_filter('submit_job_form_fields', 'bk_prefill_jobs_location');
function bk_prefill_jobs_location( $fields ) {
  $fields['job']['job_location']['value'] = 'Granite Falls, WA';
  return $fields;
}

Prefill the company logo field

add_filter('submit_job_form_fields', 'dm_prefill_company_logo'); // for users not logged in
add_filter('submit_job_form_fields_get_user_data', 'dm_prefill_company_logo'); // for logged in users
function dm_prefill_company_logo( $fields ) {
  $fields['company']['company_logo']['value'] = 'full_url_to_the_logo';
  return $fields;
}

Improve WPJM search when using Polylang

add_filter( 'get_job_listings_query_args', 'pll_wpjm_change_search' );

function pll_wpjm_change_search( $args ) {
  if ( function_exists( 'pll_current_language' ) ) {
    $args['lang'] = pll_current_language();
  }
  return $args;
}

Hide ‘hired’ candidates from applications list in Job Dashboard

add_filter( 'job_manager_job_applications_args', 'dj_hide_hired_applications' );

function dj_hide_hired_applications( $args ) {
 $args['post_status'] = array_diff( array_merge( array_keys( get_job_application_statuses() ), array( 'publish' ) ), array( 'archived' ), array( 'hired' ) );
 return $args;
}

Add Display Job Categories Shortcode

After adding the snippet, you can use the shortcode [list_categories] on a page to display the job categories. Please bear in mind that they will also link to the archive of job listings of the categories only if your theme has enabled full template support.

Add Display Job Categories Shortcode for a single listing

Redirect to Job Dashboard after job submission

Make custom meta field searchable

Change the From: details for the Applications Employer notification

Change the From: details for the Applications Candidate notification

Remove a field from the job submission page

For more info on how to customize the job submission fields, check this tutorial.

Enable comments on job listings

Change the number of tags displaying on the job listing page

By default, the Job Tags add-on displays 25 tags on the job listing page. You can change 25 to any number you want.

Exclude resume (CV) files in notification emails to employers

By default, in WPJM Applications, when applicants apply for a job, WPJM sends emails to employers including resume files. Using this snippet will exclude these files.

Add a custom email frequency for WPJM Job Alerts

The following example will add a new frequency “Monthy” for WPJM Job Alerts.

Remove all company details from the job submission page

If you want to remove the company details from the job submission form, for example if all jobs are internal, or for the same company, you can do so by using the following snippet:

Change the default Job Type in job submission form to ‘freelance’

Show hidden WooCommerce products when selecting a job package

Add company logo to RSS Feed