Skip to content

Commit

Permalink
Twenty Twenty-One: Check for WP_Error before outputting `get_the_ta…
Browse files Browse the repository at this point in the history
…g_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.

git-svn-id: https://develop.svn.wordpress.org/trunk@57991 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Apr 14, 2024
1 parent d898ee7 commit f6747a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-content/themes/twentytwentyone/inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function twenty_twenty_one_entry_meta_footer() {
}

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

$tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
if ( $tags_list ) {
if ( $tags_list && ! is_wp_error( $tags_list ) ) {
printf(
/* translators: %s: List of tags. */
'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
Expand Down

0 comments on commit f6747a3

Please sign in to comment.