Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Correct transcript link term check.

WordPress oh-so-helpfully returns an object on failure, so we need to
make sure it's returning the correct object.
  • Loading branch information...
commit 6d75832184a9312d830364b43837d8382d4e39d9 1 parent 388face
Michael Sisk authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 -/php/tags.php
View
4 -/php/tags.php
@@ -1483,11 +1483,11 @@ public static function get_webcomic_transcripts_link( $language = false, $the_po
$link = apply_filters( 'the_permalink', get_permalink( $the_post ) );
- if ( $term = get_term( $language, 'webcomic_language' ) ) {
+ if ( $term = get_term( $language, 'webcomic_language' ) and !empty( $term->slug ) ) {
$link = $wp_rewrite->using_permalinks() ? user_trailingslashit( trailingslashit( $link ) . "transcripts/{$term->slug}" ) : add_query_arg( array( 'transcripts' => $term->slug ), $link );
}
- return apply_filters( 'get_webcomic_transcripts_link', $link . ( self::have_webcomic_transcripts( false, $term ? $term->slug : '' ) ? '#webcomic-transcripts' : '#webcomic-transcribe0' ), $language, $the_post );
+ return apply_filters( 'get_webcomic_transcripts_link', $link . ( self::have_webcomic_transcripts( false, ( $term and !empty( $term->slug ) ) ? $term->slug : '' ) ? '#webcomic-transcripts' : '#webcomic-transcribe0' ), $language, $the_post );
}
/** Return a webcomic transcripts link.
Please sign in to comment.
Something went wrong with that request. Please try again.