Created
June 17, 2024 12:46
-
-
Save damadorPL/967dd4b737cd95b5c388eb1f6a4901ad to your computer and use it in GitHub Desktop.
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
/* | |
CHANGE SLUGS OF CUSTOM POST TYPES | |
*/ | |
function change_post_types_slug( $args, $post_type ) { | |
/*item post type slug*/ | |
if ( 'program' === $post_type ) { | |
$args['rewrite']['slug'] = 'place'; | |
} | |
return $args; | |
} | |
add_filter( 'register_post_type_args', 'change_post_types_slug', 10, 2 ); | |
/* | |
CHANGE SLUGS OF TAXONOMIES, slugs used for archive pages | |
*/ | |
function change_taxonomies_slug( $args, $taxonomy ) { | |
/*item category*/ | |
if ( 'program-category' === $taxonomy ) { | |
$args['rewrite']['slug'] = 'locations'; | |
} | |
return $args; | |
} | |
add_filter( 'register_taxonomy_args', 'change_taxonomies_slug', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment