[wp-trac] [WordPress Trac] #43941: Add default value to register meta
WordPress Trac
noreply at wordpress.org
Thu May 28 00:25:36 UTC 2020
#43941: Add default value to register meta
-------------------------------------------------+-------------------------
Reporter: spacedmonkey | Owner:
| johnbillion
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 5.5
Component: Options, Meta APIs | Version: 4.6
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests early | Focuses: rest-api
needs-dev-note |
-------------------------------------------------+-------------------------
Comment (by spacedmonkey):
In [https://core.trac.wordpress.org/attachment/ticket/43941/43941.15.diff
43941.15.diff] I tweaked the `filter_default_metadata` function.
Basically, I looped for the `$wp_meta_keys`, checking if the meta type,
meta key and if the default value is set, before loading the sub type.
That means that basically the sub type will not be loaded.
I am happy with this tweak, as the unit tests are still passing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43941#comment:61>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list