Skip to content

Instantly share code, notes, and snippets.

@bryceadams
Created January 28, 2015 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryceadams/e46a5177e04421acece7 to your computer and use it in GitHub Desktop.
Save bryceadams/e46a5177e04421acece7 to your computer and use it in GitHub Desktop.
add_filter( 'submit_resume_form_save_resume_data', 'custom_submit_resume_form_save_resume_data', 10, 5 );
function custom_submit_resume_form_save_resume_data( $data, $post_title, $post_content, $status, $values ) {
// No random prefix - just use post title as the permalink/slug
$data['post_name'] = sanitize_title( $post_title );
// This line appends the location of the user
$data['post_name'] .= '-' . sanitize_title( $values['resume_fields']['candidate_location'] );
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment