[wp-trac] [WordPress Trac] #55889: Allow specifying multiple keys as an array in meta and option retrieval functions.

WordPress Trac noreply at wordpress.org
Wed Jun 1 08:00:27 UTC 2022


#55889: Allow specifying multiple keys as an array in meta and option retrieval
functions.
--------------------------------+-----------------------------
 Reporter:  namith.jawahar      |      Owner:  (none)
     Type:  feature request     |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:
 Severity:  normal              |   Keywords:
  Focuses:  performance         |
--------------------------------+-----------------------------
 Allow specifying multiple keys as an array in meta and option retrieval
 functions like get_option and get_post_meta.

 Currently when we have to get multiple meta values from multiple keys we
 have to use get_post_meta without mentioning the key to retrieve
 everything or make multiple calls to the function for each key.  It will
 be really helpfull and a lot more efficient if one can specify the keys in
 the function call as follows
 get_post_meta(post_id, array('key_1, 'key_2'...))

 Same applies to get_option.

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


More information about the wp-trac mailing list