Commit 6cf44295 authored by Sergey Biryukov's avatar Sergey Biryukov
Browse files

Options, Meta APIs: Update the docs around default metadata values.

Add a missing @since value for 5.5 and potential default filter names.

Props johnbillion.
Reviewed by whyisjake, SergeyBiryukov.
Merges [48777] and [48778] to the 5.5 branch.
Fixes #50891.
Built from https://develop.svn.wordpress.org/branches/5.5@48779


git-svn-id: https://core.svn.wordpress.org/branches/5.5@48541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent c61b0a99
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -543,6 +543,13 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal
	 * (post, comment, term, user, or any other type with an associated meta table).
	 * Returning a non-null value will effectively short-circuit the function.
	 *
	 * Possible filter names include:
	 *
	 *  - `get_post_metadata`
	 *  - `get_comment_metadata`
	 *  - `get_term_metadata`
	 *  - `get_user_metadata`
	 *
	 * @since 3.1.0
	 * @since 5.5.0 Added the `$meta_type` parameter.
	 *
@@ -590,7 +597,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,11 +620,18 @@ function get_metadata_default( $meta_type, $object_id, $meta_key, $single = fals
	}

	/**
	 * Filter the default value for a specified object.
	 * Filters 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).
	 *
	 * Possible filter names include:
	 *
	 *  - `default_post_metadata`
	 *  - `default_comment_metadata`
	 *  - `default_term_metadata`
	 *  - `default_user_metadata`
	 *
	 * @since 5.5.0
	 *
	 * @param mixed  $value     The value to return, either a single metadata value or an array
@@ -1227,6 +1241,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.
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 *
 * @global string $wp_version
 */
$wp_version = '5.5-RC2-48776';
$wp_version = '5.5-RC2-48779';

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