From ac3da372a182f251c2047606b5c6e8f92f3114e8 Mon Sep 17 00:00:00 2001 From: Nirav Sherasiya Date: Tue, 19 Mar 2024 14:41:01 +0530 Subject: [PATCH] Add wp error check for return variable to prevent fatal error --- src/wp-content/themes/twentytwentyone/inc/template-tags.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-content/themes/twentytwentyone/inc/template-tags.php b/src/wp-content/themes/twentytwentyone/inc/template-tags.php index fbd10bcbc0f6f..6c93ead88270d 100644 --- a/src/wp-content/themes/twentytwentyone/inc/template-tags.php +++ b/src/wp-content/themes/twentytwentyone/inc/template-tags.php @@ -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. */ '' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '', @@ -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. */ '' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '',