[wp-trac] [WordPress Trac] #58223: twentytwenty_end_of_post_meta_list needs global $has_meta

WordPress Trac noreply at wordpress.org
Sun Apr 30 00:14:07 UTC 2023


#58223: twentytwenty_end_of_post_meta_list needs global $has_meta
---------------------------+-----------------------------
 Reporter:  chiefastro     |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Bundled Theme  |    Version:
 Severity:  normal         |   Keywords:
  Focuses:  template       |
---------------------------+-----------------------------
 There’s a bug in the Twenty Twenty theme in twentytwenty_get_post_meta.
 The bug prevents the action hooks twentytwenty_start_of_post_meta_list and
 twentytwenty_end_of_post_meta_list from displaying additional meta data
 when the default meta data fields are not populated.

 The variable $has_meta must be true for any meta to be displayed. It is
 set to false initially and is only set to true if one of the default meta
 are provided. For single-bottom, if no tags are in the post, $has_meta
 will be false regardless of additional meta attempting to be displayed by
 the action hooks.

 I solved the bug by defining $has_meta as a global inside
 twentytwenty_get_post_meta. From there, I was able to modify it’s value to
 true within my action hook function.

 Hope this can be fixed in the published version of the theme so I don’t
 have to use a hacked version.

 I posted on the theme support page and was asked to post a bug in this
 forum instead. Link to my theme support post:
 [https://wordpress.org/support/topic/twentytwenty_end_of_post_meta_list-
 needs-global-has_meta/]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58223>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list