diff -r 48c4eec2b7e6 -r 8c2e4d02f4ef wp/wp-includes/blocks/post-terms.php --- a/wp/wp-includes/blocks/post-terms.php Fri Sep 05 18:40:08 2025 +0200 +++ b/wp/wp-includes/blocks/post-terms.php Fri Sep 05 18:52:52 2025 +0200 @@ -24,11 +24,6 @@ return ''; } - $post_terms = get_the_terms( $block->context['postId'], $attributes['term'] ); - if ( is_wp_error( $post_terms ) || empty( $post_terms ) ) { - return ''; - } - $classes = array( 'taxonomy-' . $attributes['term'] ); if ( isset( $attributes['textAlign'] ) ) { $classes[] = 'has-text-align-' . $attributes['textAlign']; @@ -51,13 +46,19 @@ $suffix = '' . $attributes['suffix'] . '' . $suffix; } - return get_the_term_list( + $post_terms = get_the_term_list( $block->context['postId'], $attributes['term'], wp_kses_post( $prefix ), '' . esc_html( $separator ) . '', wp_kses_post( $suffix ) ); + + if ( is_wp_error( $post_terms ) || empty( $post_terms ) ) { + return ''; + } + + return $post_terms; } /**