Bundled Themes: Consistently check for `WP_Error` before outputting `get_the_tag_list()`.
Some themes already had these checks in place as a result of [41756], but not others. Props sixhours, davidakennedy, SergeyBiryukov. Fixes #39860. Built from https://develop.svn.wordpress.org/trunk@47886 git-svn-id: http://core.svn.wordpress.org/trunk@47660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
37db988ca7
commit
fd37adae94
|
@ -501,7 +501,7 @@ if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
|
|||
$categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
|
||||
|
||||
/* translators: Used between list items, there is a space after the comma. */
|
||||
$tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
|
||||
$tags_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
|
||||
|
||||
$date = sprintf(
|
||||
'<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
|
||||
|
@ -519,7 +519,7 @@ if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
|
|||
get_the_author()
|
||||
);
|
||||
|
||||
if ( $tag_list ) {
|
||||
if ( $tags_list && ! is_wp_error( $tags_list ) ) {
|
||||
/* translators: 1: Category name, 2: Tag name, 3: Date, 4: Author display name. */
|
||||
$utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
|
||||
} elseif ( $categories_list ) {
|
||||
|
@ -533,7 +533,7 @@ if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
|
|||
printf(
|
||||
$utility_text,
|
||||
$categories_list,
|
||||
$tag_list,
|
||||
$tags_list,
|
||||
$date,
|
||||
$author
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue