Docs: Correct comment formatting in `wp_autosave_post_revisioned_meta_fields()`.
Follow-up to [56714]. See #61608. Built from https://develop.svn.wordpress.org/trunk@58961 git-svn-id: http://core.svn.wordpress.org/trunk@58357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d7a3815245
commit
c585121d5e
|
@ -2005,7 +2005,7 @@ function wp_create_post_autosave( $post_data ) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Autosave the revisioned meta fields.
|
||||
* Autosaves the revisioned meta fields.
|
||||
*
|
||||
* Iterates through the revisioned meta fields and checks each to see if they are set,
|
||||
* and have a changed value. If so, the meta value is saved and attached to the autosave.
|
||||
|
@ -2027,15 +2027,14 @@ function wp_autosave_post_revisioned_meta_fields( $new_autosave ) {
|
|||
$post_type = get_post_type( $new_autosave['post_parent'] );
|
||||
|
||||
/*
|
||||
* Go thru the revisioned meta keys and save them as part of the autosave, if
|
||||
* the meta key is part of the posted data, the meta value is not blank and
|
||||
* the the meta value has changes from the last autosaved value.
|
||||
* Go through the revisioned meta keys and save them as part of the autosave,
|
||||
* if the meta key is part of the posted data, the meta value is not blank,
|
||||
* and the meta value has changes from the last autosaved value.
|
||||
*/
|
||||
foreach ( wp_post_revision_meta_keys( $post_type ) as $meta_key ) {
|
||||
|
||||
if (
|
||||
isset( $posted_data[ $meta_key ] ) &&
|
||||
get_post_meta( $new_autosave['ID'], $meta_key, true ) !== wp_unslash( $posted_data[ $meta_key ] )
|
||||
if ( isset( $posted_data[ $meta_key ] )
|
||||
&& get_post_meta( $new_autosave['ID'], $meta_key, true ) !== wp_unslash( $posted_data[ $meta_key ] )
|
||||
) {
|
||||
/*
|
||||
* Use the underlying delete_metadata() and add_metadata() functions
|
||||
|
@ -2044,13 +2043,9 @@ function wp_autosave_post_revisioned_meta_fields( $new_autosave ) {
|
|||
*/
|
||||
delete_metadata( 'post', $new_autosave['ID'], $meta_key );
|
||||
|
||||
/*
|
||||
* One last check to ensure meta value not empty().
|
||||
*/
|
||||
// One last check to ensure meta value is not empty.
|
||||
if ( ! empty( $posted_data[ $meta_key ] ) ) {
|
||||
/*
|
||||
* Add the revisions meta data to the autosave.
|
||||
*/
|
||||
// Add the revisions meta data to the autosave.
|
||||
add_metadata( 'post', $new_autosave['ID'], $meta_key, $posted_data[ $meta_key ] );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.7-alpha-58960';
|
||||
$wp_version = '6.7-alpha-58961';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue