From 52df01d9617c7afd2cb5fdcd2e1154a769927256 Mon Sep 17 00:00:00 2001 From: whyisjake Date: Mon, 10 Aug 2020 15:42:04 +0000 Subject: [PATCH] Options, Meta APIs: Update the docs around default metadata values. 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 --- wp-includes/meta.php | 13 ++++++++++--- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/wp-includes/meta.php b/wp-includes/meta.php index 213bfd6a73..303fb29679 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -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. @@ -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 * @@ -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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 6604a453a7..ad87342b42 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.