• Resolved blaivas

    (@blaivas)


    I have been trying to understand tutorial from here: https://wpjobmanager.com/document/tutorial-changing-the-job-slugpermalink/, but it is lacking descriptions and for me – non-programmer its absolutely not clear what to do in here.

    I want to make blabla.com/jobtitle/location

    So far I have figured this code:

    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();
    
    	// Prepend with company name
    	if ( ! empty( $post_title['job']['job_title'] ) )
    		$job_slug[] = $job_title['job']['job_title'];
    
    	// Prepend location
    	if ( ! empty( $values['job']['job_location'] ) )
    		$job_slug[] = $values['job']['job_location'];
    
    	$job_slug[] = $post_title; 
    
        $data['post_name'] = implode( '-', $job_slug );
    
        return $data;
    }

    but this code gives me blabla.com/location-jobtitle/
    and what I need is blabla.com/jobtitle/location/ or at least
    blabla.com/jobtitle-location/

    It looks like I just need to swap something, and I tried many ways,but I was not able to figure it out. Could you please help me a little here?
    Thank you

    https://www.ads-software.com/plugins/wp-job-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Permalink location/title to title/location’ is closed to new replies.