Skip to content

Commit 3707a6c

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@52660 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 174b258 commit 3707a6c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-includes/post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,7 +2475,7 @@ function add_post_meta( $post_id, $meta_key, $meta_value, $unique = false ) {
24752475
* @return bool True on success, false on failure.
24762476
*/
24772477
function delete_post_meta( $post_id, $meta_key, $meta_value = '' ) {
2478-
// Make sure meta is added to the post, not a revision.
2478+
// Make sure meta is deleted from the post, not from a revision.
24792479
$the_post = wp_is_post_revision( $post_id );
24802480
if ( $the_post ) {
24812481
$post_id = $the_post;
@@ -2527,7 +2527,7 @@ function get_post_meta( $post_id, $key = '', $single = false ) {
25272527
* is the same as the one that is already in the database.
25282528
*/
25292529
function update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) {
2530-
// Make sure meta is added to the post, not a revision.
2530+
// Make sure meta is updated for the post, not for a revision.
25312531
$the_post = wp_is_post_revision( $post_id );
25322532
if ( $the_post ) {
25332533
$post_id = $the_post;

0 commit comments

Comments
 (0)