Docs: Improve documentation for meta revision functions.

Includes:

* Correcting the position of `@since 6.4.0` in a few places.
* Adding missing `@return` documentation.
* Adjusting parameter spacing.

Follow-up to [56714].

Props jeremyfelt, mukesh27.
Fixes #59666.
Built from https://develop.svn.wordpress.org/trunk@56984


git-svn-id: http://core.svn.wordpress.org/trunk@56495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-10-23 13:17:22 +00:00
parent c7919d32db
commit a2b495afa9
2 changed files with 9 additions and 9 deletions

View File

@ -516,10 +516,10 @@ function wp_restore_post_revision( $revision, $fields = null ) {
/** /**
* Restore the revisioned meta values for a post. * Restore the revisioned meta values for a post.
* *
* @since 6.4.0
*
* @param int $post_id The ID of the post to restore the meta to. * @param int $post_id The ID of the post to restore the meta to.
* @param int $revision_id The ID of the revision to restore the meta from. * @param int $revision_id The ID of the revision to restore the meta from.
*
* @since 6.4.0
*/ */
function wp_restore_post_revision_meta( $post_id, $revision_id ) { function wp_restore_post_revision_meta( $post_id, $revision_id ) {
$post_type = get_post_type( $post_id ); $post_type = get_post_type( $post_id );
@ -540,11 +540,11 @@ function wp_restore_post_revision_meta( $post_id, $revision_id ) {
/** /**
* Copy post meta for the given key from one post to another. * Copy post meta for the given key from one post to another.
* *
* @since 6.4.0
*
* @param int $source_post_id Post ID to copy meta value(s) from. * @param int $source_post_id Post ID to copy meta value(s) from.
* @param int $target_post_id Post ID to copy meta value(s) to. * @param int $target_post_id Post ID to copy meta value(s) to.
* @param string $meta_key Meta key to copy. * @param string $meta_key Meta key to copy.
*
* @since 6.4.0
*/ */
function _wp_copy_post_meta( $source_post_id, $target_post_id, $meta_key ) { function _wp_copy_post_meta( $source_post_id, $target_post_id, $meta_key ) {
@ -563,7 +563,6 @@ function _wp_copy_post_meta( $source_post_id, $target_post_id, $meta_key ) {
* @since 6.4.0 * @since 6.4.0
* *
* @param string $post_type The post type being revisioned. * @param string $post_type The post type being revisioned.
*
* @return array An array of meta keys to be revisioned. * @return array An array of meta keys to be revisioned.
*/ */
function wp_post_revision_meta_keys( $post_type ) { function wp_post_revision_meta_keys( $post_type ) {
@ -587,7 +586,7 @@ function wp_post_revision_meta_keys( $post_type ) {
* *
* @since 6.4.0 * @since 6.4.0
* *
* @param array $keys An array of meta fields to be revisioned. * @param array $keys An array of meta fields to be revisioned.
* @param string $post_type The post type being revisioned. * @param string $post_type The post type being revisioned.
*/ */
return apply_filters( 'wp_post_revision_meta_keys', $wp_revisioned_meta_keys, $post_type ); return apply_filters( 'wp_post_revision_meta_keys', $wp_revisioned_meta_keys, $post_type );
@ -596,11 +595,12 @@ function wp_post_revision_meta_keys( $post_type ) {
/** /**
* Check whether revisioned post meta fields have changed. * Check whether revisioned post meta fields have changed.
* *
* @since 6.4.0
*
* @param bool $post_has_changed Whether the post has changed. * @param bool $post_has_changed Whether the post has changed.
* @param WP_Post $last_revision The last revision post object. * @param WP_Post $last_revision The last revision post object.
* @param WP_Post $post The post object. * @param WP_Post $post The post object.
* * @return bool Whether the post has changed.
* @since 6.4.0
*/ */
function wp_check_revisioned_meta_fields_have_changed( $post_has_changed, WP_Post $last_revision, WP_Post $post ) { function wp_check_revisioned_meta_fields_have_changed( $post_has_changed, WP_Post $last_revision, WP_Post $post ) {
foreach ( wp_post_revision_meta_keys( $post->post_type ) as $meta_key ) { foreach ( wp_post_revision_meta_keys( $post->post_type ) as $meta_key ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.5-alpha-56983'; $wp_version = '6.5-alpha-56984';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.