Make WordPress Core

Changeset 45724 for trunk


Ignore:
Timestamp:
08/03/2019 03:46:46 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Check the result of wp_update_post() in wp_trash_post() and wp_untrash_post().

Props abhijitrakas, manzoorwani.jk, siliconforks.
Fixes #47773.

File:
1 edited

Legend:

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

    r45674 r45724  
    30603060        add_post_meta( $post_id, '_wp_trash_meta_time', time() );
    30613061
    3062         wp_update_post(
     3062        $post_updated = wp_update_post(
    30633063                array(
    30643064                        'ID'          => $post_id,
    … …  
    30663066                )
    30673067        );
     3068
     3069        if ( ! $post_updated ) {
     3070                return false;
     3071        }
    30683072
    30693073        wp_trash_post_comments( $post_id );
    … …  
    31273131        delete_post_meta( $post_id, '_wp_trash_meta_time' );
    31283132
    3129         wp_update_post(
     3133        $post_updated = wp_update_post(
    31303134                array(
    31313135                        'ID'          => $post_id,
    … …  
    31333137                )
    31343138        );
     3139
     3140        if ( ! $post_updated ) {
     3141                return false;
     3142        }
    31353143
    31363144        wp_untrash_post_comments( $post_id );
Note: See TracChangeset for help on using the changeset viewer.