[wp-trac] [WordPress Trac] #43941: Add default value to register meta

WordPress Trac noreply at wordpress.org
Wed Jun 27 00:17:10 UTC 2018


#43941: Add default value to register meta
----------------------------------------+---------------------------
 Reporter:  spacedmonkey                |       Owner:  spacedmonkey
     Type:  enhancement                 |      Status:  assigned
 Priority:  normal                      |   Milestone:  5.0
Component:  Options, Meta APIs          |     Version:  4.6
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  rest-api
----------------------------------------+---------------------------

Comment (by flixos90):

 I think we should discuss in detail in a REST API meeting whether
 `register_meta()` should require `default` to always be a `$single` value
 or whether it should dynamically adjust depending on whether `$single` is
 true or false. I'm thinking we need to do the latter because otherwise it
 would be impossible to register an array of default values where `$single`
 is false, which would be a perfectly valid use-case.

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


More information about the wp-trac mailing list