From f40c2a62a606768b577c4c79f9d9a8d7f7de7e02 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 11 Oct 2016 03:27:31 +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. Built from https://develop.svn.wordpress.org/trunk@38777 git-svn-id: http://core.svn.wordpress.org/trunk@38720 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 7 ++++++- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 837adce81d..8d36a25001 100644 --- a/wp-includes/category-template.php +++ b/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; + } } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 35dfc2f240..01ad23b478 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38776'; +$wp_version = '4.7-alpha-38777'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.