From a5c45366cbcf22d3228bc65ef69a50bb1f21ae64 Mon Sep 17 00:00:00 2001 From: davidbaumwald Date: Tue, 1 Feb 2022 17:12:03 +0000 Subject: [PATCH] Options, Meta APIs: Correct some inline docs for `update_post_meta` and `delete_post_meta`. In `update_post_meta` and `delete_post_meta`, code was added to fetch the parent post if these functions were called for a revision post ID. In [9252], the code was apparently copied from `add_post_meta`, and the inline comment describing the new block of code was not updated to mention either "updated" or "deleted" respectively. This change corrects the comment in both functions to reflect the current action instead of "added". Props thelovekesh, rehanali. Fixes #54835. Built from https://develop.svn.wordpress.org/trunk@52660 git-svn-id: http://core.svn.wordpress.org/trunk@52249 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 582e17a863..9f02fff09d 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2475,7 +2475,7 @@ function add_post_meta( $post_id, $meta_key, $meta_value, $unique = false ) { * @return bool True on success, false on failure. */ function delete_post_meta( $post_id, $meta_key, $meta_value = '' ) { - // Make sure meta is added to the post, not a revision. + // Make sure meta is deleted from the post, not from a revision. $the_post = wp_is_post_revision( $post_id ); if ( $the_post ) { $post_id = $the_post; @@ -2527,7 +2527,7 @@ function get_post_meta( $post_id, $key = '', $single = false ) { * is the same as the one that is already in the database. */ function update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) { - // Make sure meta is added to the post, not a revision. + // Make sure meta is updated for the post, not for a revision. $the_post = wp_is_post_revision( $post_id ); if ( $the_post ) { $post_id = $the_post; diff --git a/wp-includes/version.php b/wp-includes/version.php index 9ba6dea731..3ef1359f5e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52659'; +$wp_version = '6.0-alpha-52660'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.