[wp-trac] [WordPress Trac] #30995: Pass meta_id when retrieving multiple metas

WordPress Trac noreply at wordpress.org
Mon Jan 12 20:18:51 UTC 2015


#30995: Pass meta_id when retrieving multiple metas
--------------------------------+-----------------------------
 Reporter:  GregLone            |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  2.9
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 Hello.

 In some (edge?) cases we would need a unique identifier when we retrieve
 metas. For example, `get_post_custom_values( '_yolo', $post->ID )` will
 return:

 {{{
 Array
 (
     [0] => foo
     [1] => bar
 )
 }}}

 while the following, with the `meta_id` as array key, would be helpful
 imho:

 {{{
 Array
 (
     [1022] => foo
     [1029] => bar
 )
 }}}

 The modification is trivial in `update_meta_cache()`, and some other
 functions would only need something like `metas[0]` => `reset( metas )`.

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


More information about the wp-trac mailing list