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

WordPress Trac noreply at wordpress.org
Fri Nov 24 09:03:38 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             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 '''get_post_meta call:'''
 {{{#!php
 $post_meta = get_post_meta( $post_id, '', true );
 }}}

 '''Result:'''
 {{{#!php
 array(
 'post_meta_1' => array('post_meta_1_value'),
 'post_meta_2' => array('post_meta_2_value')
 )
 }}}


 '''Expected result'''
 {{{#!php
 array(
 'post_meta_1' => 'post_meta_1_value',
 'post_meta_2' => 'post_meta_2_value'
 )
 }}}

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


More information about the wp-trac mailing list