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

WordPress Trac noreply at wordpress.org
Wed Mar 13 00:52:00 UTC 2019


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

Comment (by spacedmonkey):

 In [https://core.trac.wordpress.org/attachment/ticket/43941/43941.3.diff
 43941.3.diff] I have created a brand new patch after a chat IRL with
 @flixos90 and @swissspidy .

 This new patch, allows developers to register single and multiple
 defaults. For single defaults (single => true), any value that passed as
 default, is used. However, defaults (single => false) REQUIRES a numbric
 array be passed. I think that this patch is a workable solution.

 Once we are happy, I can add some unit tests.

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


More information about the wp-trac mailing list