Skip to content
Browse files

Correct storyline permalink structure.

  • Loading branch information...
1 parent 4c865b1 commit 2354a5f59603cd98e31597911f421eb9353be74f Michael Sisk committed Feb 23, 2013
Showing with 6 additions and 9 deletions.
  1. +6 −9 webcomic.php
View
15 webcomic.php
@@ -1276,20 +1276,17 @@ public function post_type_link( $link, $post, $name, $sample ) {
if ( false !== strpos( $link, "%{$post->post_type}_storyline%" ) and $storylines = get_the_terms( $post->ID, "{$post->post_type}_storyline" ) and !is_wp_error( $storylines ) ) {
$storylines = array_reverse( $storylines );
- $storyline = $storylines[ 0 ]->slug;
+ $storyline = array( $storylines[ 0 ]->slug );
if ( $parent = $storylines[ 0 ]->parent and $parents = get_ancestors( $storylines[ 0 ]->term_id, $storylines[ 0 ]->taxonomy ) ) {
- $storyline = array();
-
foreach ( $parents as $parent ) {
- $the_parent = get_term( $parent, $storylines[ 0 ]->taxonomy );
- $storylines[] = $the_parent->slug;
+ $the_parent = get_term( $parent, $storylines[ 0 ]->taxonomy );
+ $storyline[] = $the_parent->slug;
}
-
- $storyline = array_reverse( $storylines );
- $storyline[] = $storylines[ 0 ]->slug;
- $storyline = join( '/', $storyline );
}
+
+ $storyline = array_reverse( $storyline );
+ $storyline = join( '/', $storyline );
} else {
$storyline = '';
}

0 comments on commit 2354a5f

Please sign in to comment.
Something went wrong with that request. Please try again.