[wp-trac] [WordPress Trac] #56718: register_post_meta not being initialized default value right away

WordPress Trac noreply at wordpress.org
Thu Sep 7 11:27:53 UTC 2023


#56718: register_post_meta not being initialized default value right away
--------------------------------+------------------------------
 Reporter:  kaimaniiii          |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:  5.5
 Severity:  normal              |  Resolution:
 Keywords:  dev-feedback        |     Focuses:
--------------------------------+------------------------------

Comment (by spacedmonkey):

 Replying to [comment:2 kaimaniiii]:

 > Is there some sort of way I can make it always return "true" instead of
 "1"?

 You could do something like this

 {{{#!php
  (bool) get_post_meta($postId, 'isVisibleFeatureImage', true);
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56718#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list