Changeset 5643
- Timestamp:
- 07/11/2017 01:45:28 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php
r5318 r5643 13 13 $zip_files = array(); 14 14 foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) { 15 $zip_files[ $zip_file->post_date ] = wp_get_attachment_url( $zip_file->ID);15 $zip_files[ $zip_file->post_date ] = array( wp_get_attachment_url( $zip_file->ID ), $zip_file ); 16 16 } 17 17 uksort( $zip_files, function( $a, $b ) { … … 21 21 if ( $zip_url = get_post_meta( $post->ID, '_submitted_zip', true ) ) { 22 22 // Back-compat only. 23 $zip_files[ 'User provided URL' ] = $zip_url;23 $zip_files[ 'User provided URL' ] = array( $zip_url, null ); 24 24 } 25 25 26 foreach ( $zip_files as $zip_date => $zip_url ) { 26 foreach ( $zip_files as $zip_date => $zip ) { 27 list( $zip_url, $zip_file ) = $zip; 28 $zip_size = ( is_object( $zip_file ) ? size_format( filesize( get_attached_file( $zip_file->ID ) ), 1 ) : __( 'unknown size', 'wporg-plugins' ) ); 27 29 printf( '<p>' . __( '<strong>Zip file:</strong> %s', 'wporg-plugins' ) . '</p>', 28 sprintf( '%s <a href="%s">%s</a> ', esc_html( $zip_date ), esc_url( $zip_url ), esc_html( $zip_url) )30 sprintf( '%s <a href="%s">%s</a> (%s)', esc_html( $zip_date ), esc_url( $zip_url ), esc_html( $zip_url ), esc_html( $zip_size ) ) 29 31 ); 30 32 }
Note: See TracChangeset
for help on using the changeset viewer.