Created
July 5, 2016 07:30
-
-
Save danjjohnson/87043804aa2ad383744a8949b7fc15e4 to your computer and use it in GitHub Desktop.
WPJM - change job slug to name-location
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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