From d7efb280da01c6f803b973e03c7f7efd4bd7f1c5 Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava Date: Fri, 8 May 2026 13:17:33 +0530 Subject: [PATCH 1/2] Twenty Twenty: Fix twentytwenty_get_post_meta to return output from action hooks when no default meta exists --- src/wp-content/themes/twentytwenty/inc/template-tags.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-content/themes/twentytwenty/inc/template-tags.php b/src/wp-content/themes/twentytwenty/inc/template-tags.php index e15ae6652bbec..0aa829479a534 100644 --- a/src/wp-content/themes/twentytwenty/inc/template-tags.php +++ b/src/wp-content/themes/twentytwenty/inc/template-tags.php @@ -524,7 +524,8 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) $meta_output = ob_get_clean(); // If there is meta to output, return it. - if ( $has_meta && $meta_output ) { + $meta_output_inner = trim( strip_tags( $meta_output ) ); + if ( ( $has_meta || '' !== $meta_output_inner ) && $meta_output ) { return $meta_output; From fb47a6faaa1681db7cf22e5c0fc4ededda41e00b Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 12 May 2026 09:55:56 +0530 Subject: [PATCH 2/2] Update src/wp-content/themes/twentytwenty/inc/template-tags.php Co-authored-by: Stephen A. Bernhardt --- src/wp-content/themes/twentytwenty/inc/template-tags.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wp-content/themes/twentytwenty/inc/template-tags.php b/src/wp-content/themes/twentytwenty/inc/template-tags.php index 0aa829479a534..457cc73fc2686 100644 --- a/src/wp-content/themes/twentytwenty/inc/template-tags.php +++ b/src/wp-content/themes/twentytwenty/inc/template-tags.php @@ -524,8 +524,7 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) $meta_output = ob_get_clean(); // If there is meta to output, return it. - $meta_output_inner = trim( strip_tags( $meta_output ) ); - if ( ( $has_meta || '' !== $meta_output_inner ) && $meta_output ) { + if ( ( $has_meta && $meta_output ) || '' !== wp_strip_all_tags( $meta_output ) ) { return $meta_output;