[wp-trac] [WordPress Trac] #58223: Twenty Twenty: twentytwenty_get_post_meta needs global $has_meta
WordPress Trac
noreply at wordpress.org
Fri May 8 08:01:10 UTC 2026
#58223: Twenty Twenty: twentytwenty_get_post_meta needs global $has_meta
---------------------------+------------------------------
Reporter: chiefastro | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: template
---------------------------+------------------------------
Comment (by shreya0shrivastava):
Hi, I've submitted a patch for this issue.
The root cause is that `$has_meta` is a local flag that only flips to
`true` when default meta fields are present, meaning the output buffer
from the action hooks gets discarded when no default meta exists.
Rather than using a global (which would pollute the global namespace and
create implicit coupling), the fix checks whether the output buffer
contains any content after stripping tags, and returns the meta wrapper if
either default meta or hook content is present.
Happy to make any changes based on feedback.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58223#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list