Skip to:
Content

bbPress.org

Changeset 7122


Ignore:
Timestamp:
08/12/2020 02:32:56 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Moderation: when approving topics & replies, manually set post_date_gmt.

This commit is necessary to prevent wp_update_post() from marking these posts as having been published immediately, instead of their original post_date.

In trunk, for 2.7.

Props SergeyBiryukov.

See #3133.

Location:
trunk/src/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/functions.php

    r7105 r7122  
    18241824    $reply->post_status = $status;
    18251825
     1826    // Set post date GMT - prevents post_date override in wp_update_post()
     1827    $reply->post_date_gmt = get_gmt_from_date( $reply->post_date );
     1828
    18261829    // No revisions
    18271830    remove_action( 'pre_post_update', 'wp_save_post_revision' );
  • trunk/src/includes/topics/functions.php

    r7105 r7122  
    32373237    $topic->post_status = $status;
    32383238
     3239    // Set post date GMT - prevents post_date override in wp_update_post()
     3240    $topic->post_date_gmt = get_gmt_from_date( $topic->post_date );
     3241
    32393242    // No revisions
    32403243    remove_action( 'pre_post_update', 'wp_save_post_revision' );
Note: See TracChangeset for help on using the changeset viewer.