Docs: Synchronize and correct documentation for various metadata functions and filters.

Follow-up to [47390], [47611], [48192], [48402].

See #49572, #43941, #45464.
Built from https://develop.svn.wordpress.org/trunk@48411


git-svn-id: http://core.svn.wordpress.org/trunk@48180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2020-07-09 11:26:07 +00:00
parent c4a2b9a9e4
commit d322fb66de
3 changed files with 155 additions and 147 deletions

View File

@@ -79,6 +79,7 @@ abstract class WP_REST_Meta_Fields {
foreach ( $fields as $meta_key => $args ) {
$name = $args['name'];
$all_values = get_metadata( $this->get_meta_type(), $object_id, $meta_key, false );
if ( $args['single'] ) {
if ( empty( $all_values ) ) {
$value = $args['schema']['default'];