Making WordPress.org


Ignore:
Timestamp:
03/12/2024 01:41:59 AM (6 months ago)
Author:
dd32
Message:

Plugin Directory: Admin: Add a Submitted Date column for simpler sorting of pending plugins.

The only other field is the 'Last Modified' date field, which increases when a new ZIP is uploaded to a draft/pending plugin.

See #7384

File:
1 edited

Legend:

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

    r13243 r13307  
    3535    public function filter_columns( $columns ) {
    3636        // Rename some columns.
    37         $columns['author']   = __( 'Submitter', 'wporg-plugins' );
    38         $columns['reviewer'] = __( 'Assigned Reviewer', 'wporg-plugins' );
    39         $columns['comments'] = '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Internal Notes', 'wporg-plugins' ) . '"><span class="screen-reader-text">' . __( 'Internal Notes', 'wporg-plugins' ) . '</span></span>';
    40         $columns['zip']      = 'Latest Zip';
    41         $columns['loc']      = 'Lines of PHP Code';
     37        $columns['author']         = __( 'Submitter', 'wporg-plugins' );
     38        $columns['reviewer']       = __( 'Assigned Reviewer', 'wporg-plugins' );
     39        $columns['comments']       = '<span class = "vers comment-grey-bubble" title = "' . esc_attr__( 'Internal Notes', 'wporg-plugins' ) . '"><span class = "screen-reader-text">' . __( 'Internal Notes', 'wporg-plugins' ) . '</span></span>';
     40        $columns['zip']            = 'Latest Zip';
     41        $columns['loc']            = 'Lines of PHP Code';
     42        $columns['submitted_date'] = 'Submitted Date';
    4243
    4344        // We don't want the stats column.
     
    5354     */
    5455    public function filter_sortable_columns( $columns ) {
    55         $columns[ 'reviewer' ] = [ 'assigned_reviewer_time', 'asc' ];
    56         $columns[ 'zip' ]      = [ '_submitted_zip_size', 'asc' ];
    57         $columns[ 'loc' ]      = [ '_submitted_zip_loc', 'asc' ];
     56        $columns[ 'reviewer' ]       = [ 'assigned_reviewer_time', 'asc' ];
     57        $columns[ 'zip' ]            = [ '_submitted_zip_size', 'asc' ];
     58        $columns[ 'loc' ]            = [ '_submitted_zip_loc', 'asc' ];
     59        $columns[ 'submitted_date' ] = [ '_submitted_date', 'asc' ];
    5860
    5961        return $columns;
     
    7779            $columns[] = 'zip';
    7880            $columns[] = 'loc';
     81            $columns[] = 'submitted_date';
    7982        }
    8083
     
    730733        echo number_format_i18n( (int) $post->_submitted_zip_loc ) ?: '-';
    731734    }
     735
     736    public function column_submitted_date( $post ) {
     737        echo gmdate( 'Y/m/d g:i a', $post->_submitted_date ?? 0 );
     738    }
    732739}
Note: See TracChangeset for help on using the changeset viewer.