Twenty Twenty-One: Check for WP_Error before outputting get_the_tag_list().

This prevents a fatal error on PHP 8 and brings consistency with the other bundled themes.

Follow-up to [47886].

Props josephscott, sabernhardt, poena, nirav7707, devsahadat.
Fixes #60800.
Built from https://develop.svn.wordpress.org/trunk@57991


git-svn-id: http://core.svn.wordpress.org/trunk@57477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-04-14 21:57:13 +00:00
parent 7bb686d18b
commit 8689afae77
2 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) {
} }
$tags_list = get_the_tag_list( '', wp_get_list_item_separator() ); $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
if ( $tags_list ) { if ( $tags_list && ! is_wp_error( $tags_list ) ) {
printf( printf(
/* translators: %s: List of tags. */ /* translators: %s: List of tags. */
'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>', '<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
@ -152,7 +152,7 @@ if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) {
} }
$tags_list = get_the_tag_list( '', wp_get_list_item_separator() ); $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
if ( $tags_list ) { if ( $tags_list && ! is_wp_error( $tags_list ) ) {
printf( printf(
/* translators: %s: List of tags. */ /* translators: %s: List of tags. */
'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>', '<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.6-alpha-57990'; $wp_version = '6.6-alpha-57991';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.