WordPress.org

Making WordPress.org

Ticket #4237: 4237.1.diff

File 4237.1.diff, 1.5 KB (added by ck3lee, 22 months ago)
  • wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php

    diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php
    index 5137ea713..640c5a568 100644
    class Status_Transitions { 
    131131                switch ( $new_status ) {
    132132                        case 'approved':
    133133                                $this->approved( $post->ID, $post );
     134                                # See https://meta.trac.wordpress.org/ticket/4237#comment:5
     135                                update_post_meta( $post->ID, "last_updated", gmdate( 'Y-m-d H:i:s', time() ) );
    134136                                break;
    135137
    136138                        case 'rejected':
    137139                                $this->rejected( $post->ID, $post );
     140                                # See https://meta.trac.wordpress.org/ticket/4237#comment:5
     141                                update_post_meta( $post->ID, "last_updated", gmdate( 'Y-m-d H:i:s', time() ) );
    138142                                break;
    139143
    140144                        case 'publish':
    class Status_Transitions { 
    148152                                $this->set_translation_status( $post, 'inactive' );
    149153                                break;
    150154                }
    151 
    152                 // Record the time a plugin was transitioned into a specific status.
    153                 if ( '0000-00-00 00:00:00' === $post->post_modified_gmt ) {
    154                         // Assume now.
    155                         update_post_meta( $post->ID, "_{$new_status}", time() );
    156                 } else {
    157                         update_post_meta( $post->ID, "_{$new_status}", strtotime( $post->post_modified_gmt ) );
    158                 }
    159         }
     155                update_post_meta( $post->ID, "_{$new_status}", time() );
     156}
    160157
    161158        /**
    162159         * Updates project status of the plugin on translate.wordpress.org.