[wp-trac] [WordPress Trac] #42687: get_post_meta() is returning arrays even when the $single value is true

WordPress Trac noreply at wordpress.org
Sat Nov 25 04:53:17 UTC 2017


#42687: get_post_meta() is returning arrays even when the $single value is true
-------------------------------+------------------------------
 Reporter:  titodevera         |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  4.9
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by chetan200891):

 Hi @titodevera welcome to trac!

 I have tested same thing in both cases.

 First get_post_meta('ID', 'meta_key', true) and get_post_meta('ID', '',
 true). I am getting correct result in both. So I guess as @dd32 mentioned
 it should be an array value in meta key. May be before you added
 update_post_meta.

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


More information about the wp-trac mailing list