From 9ef4ac356707a4de5d1ae24daa76c83f5296c120 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 11 Oct 2016 03:26:11 +0000 Subject: [PATCH] Taxonomy: Avoid a fatal error in `the_tags()` in the event that `get_the_term_list()` returns a WP_Error. Props michalzuber. See #37291. git-svn-id: https://develop.svn.wordpress.org/trunk@38777 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/category-template.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index 837adce81d..8d36a25001 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -1142,7 +1142,12 @@ function get_the_tag_list( $before = '', $sep = '', $after = '', $id = 0 ) { function the_tags( $before = null, $sep = ', ', $after = '' ) { if ( null === $before ) $before = __('Tags: '); - echo get_the_tag_list($before, $sep, $after); + + $the_tags = get_the_tag_list( $before, $sep, $after ); + + if ( ! is_wp_error( $the_tags ) ) { + echo $the_tags; + } } /**