Skip to content

Instantly share code, notes, and snippets.

@danjjohnson
Created July 5, 2016 07:30
Show Gist options
  • Select an option

  • Save danjjohnson/87043804aa2ad383744a8949b7fc15e4 to your computer and use it in GitHub Desktop.

Select an option

Save danjjohnson/87043804aa2ad383744a8949b7fc15e4 to your computer and use it in GitHub Desktop.
WPJM - change job slug to name-location
add_filter( 'submit_job_form_save_job_data', 'custom_submit_job_form_save_job_data', 10, 5 );
function custom_submit_job_form_save_job_data( $data, $post_title, $post_content, $status, $values ) {
$job_slug = array();
$job_slug[] = $post_title;
// Append location
if ( ! empty( $values['job']['job_location'] ) )
$job_slug[] = $values['job']['job_location'];
$data['post_name'] = implode( '-', $job_slug );
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment