Make WordPress Core

Changeset 52660


Ignore:
Timestamp:
02/01/2022 05:10:48 PM (2 years ago)
Author:
davidbaumwald
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r52457 r52660  
    24762476 */
    24772477function 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 ) {
     
    25282528 */
    25292529function 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 ) {
Note: See TracChangeset for help on using the changeset viewer.