Making WordPress.org


Ignore:
Timestamp:
10/29/2024 03:18:40 AM (22 months ago)
Author:
dd32
Message:

Plugin Directory: Resolve some closed plugins showing 'Last updated: 55 years ago'.

See #7057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-meta.php

    r13751 r14153  
    6161                        <li>
    6262                                <?php
    63                                 $modified_time = get_post_modified_time();
     63                                $last_updated = get_post_meta( $post->ID, 'last_updated', true );
     64                                // Fallback to modified timestamp if meta unavailable.
     65                                $last_updated = $last_updated ? strtotime( $last_updated ) : get_post_modified_time( 'U', true );
    6466
    6567                                // Fallback for approved plugins that are not published yet.
    66                                 if ( $modified_time < 0 ) {
    67                                         $modified_time = get_post_time();
     68                                if ( ! $last_updated || $last_updated < 0 ) {
     69                                        $last_updated = get_post_time( 'U', true );
    6870                                }
    6971
     
    7274                                        __( 'Last updated %s', 'wporg-plugins' ),
    7375                                        /* translators: %s: time since the last update */
    74                                         '<strong>' . wp_kses( sprintf( __( '%s ago', 'wporg-plugins' ), '<span>' . human_time_diff( $modified_time ) . '</span>' ), array( 'span' => true ) ) . '</strong>'
     76                                        '<strong>' . wp_kses( sprintf( __( '%s ago', 'wporg-plugins' ), '<span>' . human_time_diff( $last_updated ) . '</span>' ), array( 'span' => true ) ) . '</strong>'
    7577                                );
    7678                                ?>
Note: See TracChangeset for help on using the changeset viewer.