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
This commit is contained in:
parent
5fef526cca
commit
9ef4ac3567
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user