mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-10 21:00:59 +01:00
Docs: Improve documentation for meta revision functions.
Backports [56984] to 6.4 branch. 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, SergeyBiryukov. Fixes #59666. Built from https://develop.svn.wordpress.org/branches/6.4@56989 git-svn-id: http://core.svn.wordpress.org/branches/6.4@56500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
47351ffaf7
commit
f4c1afcf63
@ -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 ) {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.4-RC1-56988';
|
$wp_version = '6.4-RC1-56989';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user