Skip to content

Commit

Permalink
Options, Meta APIs: Update the docs around default metadata values.
Browse files Browse the repository at this point in the history
Add a missing @SInCE value for 5.5 and potential default filter names.

Fixes #50891.
Props johnbillion.


Built from https://develop.svn.wordpress.org/trunk@48777


git-svn-id: http://core.svn.wordpress.org/trunk@48539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
whyisjake committed Aug 10, 2020
1 parent 14d561a commit 52df01d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions wp-includes/meta.php
Expand Up @@ -590,7 +590,7 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal
}

/**
* Retrieves default metadata value for the specified object.
* Retrieves default metadata value for the specified meta key and object.
*
* By default, an empty string is returned if `$single` is true, or an empty array
* if it's false.
Expand All @@ -613,10 +613,16 @@ function get_metadata_default( $meta_type, $object_id, $meta_key, $single = fals
}

/**
* Filter the default value for a specified object.
* Filter the default metadata value for a specified meta key and object.
*
* The dynamic portion of the hook, `$meta_type`, refers to the meta object type
* (post, comment, term, user, or any other type with an associated meta table).
* (post, comment, term, user, blog, or any other type with an associated meta
* table). Possible filter names include:
*
* - `default_post_metadata`
* - `default_comment_metadata`
* - `default_term_metadata`
* - `default_user_metadata`
*
* @since 5.5.0
*
Expand Down Expand Up @@ -1227,6 +1233,7 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype =
* `$sanitize_callback` and `$auth_callback` have been folded into this array.
* @since 4.9.8 The `$object_subtype` argument was added to the arguments array.
* @since 5.3.0 Valid meta types expanded to include "array" and "object".
* @since 5.5.0 The `$default` argument was added to the arguments array.
*
* @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table.
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Expand Up @@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.6-alpha-48775';
$wp_version = '5.6-alpha-48777';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 52df01d

Please sign in to comment.