Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $terms = get_the_terms($post->ID, 'scategory'); // scategory is my custom taxonomy
- $slugs = [];
- foreach ( $terms as $term ) {
- $slugs[$term->id] = $term->slug;
- }
- ksort($slugs); // sorting by slug ids
- $finalSlug = join( '/', $slugs ); // making rewrite rule slug for custom post type
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement