Making WordPress.org

Changeset 12991

Timestamp:
12/01/2023 04:57:03 AM (8 months ago)
Author:
dd32
Message:

Plugin Directory: When storing status transition timestamps, always use the current timestamp.

When a transition event occurs, the modified date might not actually be correct, as Plugin_Directory::filter_wp_insert_post_data() respects the passed timestamp, and some actions (such as approving a plugin) don't intentionally increase the modification date.

Previously: [6873]
See #3511

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php

    r12846 r12991  
    160160
    161161        // Record the time a plugin was transitioned into a specific status.
    162         if ( '0000-00-00 00:00:00' === $post->post_modified_gmt ) {
    163             // Assume now.
    164             update_post_meta( $post->ID, "_{$new_status}", time() );
    165         } else {
    166             update_post_meta( $post->ID, "_{$new_status}", strtotime( $post->post_modified_gmt ) );
    167         }
     162        update_post_meta( $post->ID, "_{$new_status}", time() );
    168163
    169164        // Clear any relevant caches.
Note: See TracChangeset for help on using the changeset viewer.