Created
November 30, 2013 13:09
-
-
Save mikejolley/7718889 to your computer and use it in GitHub Desktop.
Change job listing base slug in WP Job Manager - requires that permalinks are saved after adding to your theme functions.php file.
This file contains 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
function change_job_listing_slug( $args ) { | |
$args['rewrite']['slug'] = _x( 'careers', 'Job permalink - resave permalinks after changing this', 'job_manager' ); | |
return $args; | |
} | |
add_filter( 'register_post_type_job_listing', 'change_job_listing_slug' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Mike,
I was wondering if I could change the slug depending on what term in a taxonomy is the post assigned to. I'm using the "Job Types" and have 2 terms within this taxonomy. These are "Books" and "Magazines"
What I'm trying to achieve is that if the post has "books" term assigned to it, the slug would change to 'books' , but if the post has 'magazines' term assigned to it, the slug would change to 'magazines'
I've been trying to play around with the following function based on your example above:
Unfortunately this doesn't work as expected. Would this be possible at all?