Customization Snippets

Note: This is a developer level doc and all these customization snippets are for informational purposes only. Our support policy does not include assistance with customizations. We can not assist with modifying or debugging code from these snippets.

This page consists of all the customization snippets we have so far. We’ll be constantly adding 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

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

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

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');

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

add_action( 'new_job_application', 'bk_redirect_now', 99);

function bk_redirect_now(){
  add_action( 'template_redirect', 'bk_final_redirect', 99);
}

function bk_final_redirect(){
  wp_redirect('https://example.com');
  exit();
}

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

add_filter( 'job_manager_job_dashboard_columns', 'remove_expires_column' );

function remove_expires_column( $columns ) {
	unset( $columns['expires_or_closing_date'] );
	return $columns;
}

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');
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 in 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.