Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. $terms = get_the_terms($post->ID, 'scategory'); // scategory is my custom taxonomy
  2. $slugs = [];
  3. foreach ( $terms as $term ) {
  4. $slugs[$term->id] = $term->slug;
  5. }
  6. ksort($slugs); // sorting by slug ids
  7. $finalSlug = join( '/', $slugs ); // making rewrite rule slug for custom post type
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement