Making WordPress.org


Ignore:
Timestamp:
04/11/2017 06:37:04 AM (7 years ago)
Author:
dd32
Message:

Plugin Directory: Introduce the 'new' post_status to replace 'draft', this will allow a better more well-defined statuses for plugins.

See #2716

File:
1 edited

Legend:

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

    r5267 r5318  
    1111        $post = get_post();
    1212
    13         $zip_url = '';
     13        $zip_files = array();
    1414        foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) {
    15             $zip_url = wp_get_attachment_url( $zip_file->ID );
    16             break;
     15            $zip_files[ $zip_file->post_date ] = wp_get_attachment_url( $zip_file->ID );
    1716        }
    18         if ( ! $zip_url ) {
    19             $zip_url = get_post_meta( $post->ID, '_submitted_zip', true );
     17        uksort( $zip_files, function( $a, $b ) {
     18            return strtotime( $a ) < strtotime( $b );
     19        } );
     20
     21        if ( $zip_url = get_post_meta( $post->ID, '_submitted_zip', true ) ) {
     22            // Back-compat only.
     23            $zip_files[ 'User provided URL' ] = $zip_url;
    2024        }
    2125
    22         if ( $zip_url ) {
     26        foreach ( $zip_files as $zip_date => $zip_url ) {
    2327            printf( '<p>' . __( '<strong>Zip file:</strong> %s', 'wporg-plugins' ) . '</p>',
    24                 sprintf( '<a href="%s">%s</a>', esc_url( $zip_url ), esc_html( $zip_url ) )
     28                sprintf( '%s <a href="%s">%s</a>', esc_html( $zip_date ), esc_url( $zip_url ), esc_html( $zip_url ) )
    2529            );
    2630        }
    2731
    28         if ( 'pending' != $post->post_status ) {
     32        if ( 'pending' != $post->post_status && 'new' != $post->post_status ) {
    2933            echo "<ul>
    3034                <li><a href='https://plugins.trac.wordpress.org/log/{$post->post_name}/'>" . __( 'Development Log', 'wporg-plugins' ) . "</a></li>
     
    3337            </ul>';
    3438        }
    35         if ( $post->post_excerpt && in_array( $post->post_status, array( 'pending', 'approved' ) ) ) {
     39        if ( $post->post_excerpt && in_array( $post->post_status, array( 'new', 'pending', 'approved' ) ) ) {
    3640            echo '<p>' . strip_tags( $post->post_excerpt ) . '</p>';
    3741        }
     
    4145           
    4246            $type   = 'Notice';
    43             if ( $post->post_status == 'draft' || $post->post_status == 'pending' ) {
     47            if ( $post->post_status == 'new' || $post->post_status == 'pending' ) {
    4448                $type = 'Request';
    4549            }
Note: See TracChangeset for help on using the changeset viewer.