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

WordPress Trac noreply at wordpress.org
Tue Jun 26 20:56:01 UTC 2018


#43941: Add default value to register meta
----------------------------------------+-----------------------
 Reporter:  spacedmonkey                |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 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 spacedmonkey):

 In [https://core.trac.wordpress.org/attachment/ticket/43941/43941.diff
 43941.diff] I have updated the patch after #38323 has been merged into
 core.

 This patch adds the following filters
 `default_{$object_type}_meta_{$meta_key}"` and
 `default_{$object_type}_meta_{$meta_key}_for_{$object_subtype}`. This
 tries to keep the format of other filters like
 `sanitize_{$object_type}_meta_{$meta_key}`.

 I have not included tests, as I am not sure, the approach is fixed and
 would love feedback on naming of functions and filters.

 CC @kadamwhite @flixos90 @rmccue

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


More information about the wp-trac mailing list