Changeset 6287 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php
- Timestamp:
- 12/19/2017 04:22:37 PM (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
r6028 r6287 1 1 <?php 2 2 namespace WordPressdotorg\Plugin_Directory\Admin\Metabox; 3 3 4 use WordPressdotorg\Plugin_Directory\Tools; 4 5 … … 14 15 $zip_files = array(); 15 16 foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) { 16 $zip_files[ $zip_file->post_date ] = array( 17 $zip_files[ $zip_file->post_date ] = array( wp_get_attachment_url( $zip_file->ID ), $zip_file ); 17 18 } 18 19 uksort( $zip_files, function( $a, $b ) { … … 22 23 if ( $zip_url = get_post_meta( $post->ID, '_submitted_zip', true ) ) { 23 24 // Back-compat only. 24 $zip_files[ 'User provided URL'] = array( $zip_url, null );25 $zip_files['User provided URL'] = array( $zip_url, null ); 25 26 } 26 27 27 28 foreach ( $zip_files as $zip_date => $zip ) { 28 29 list( $zip_url, $zip_file ) = $zip; 29 $zip_size = ( is_object( $zip_file ) ? size_format( filesize( get_attached_file( $zip_file->ID ) ), 1 ) : __( 'unknown size', 'wporg-plugins' ) ); 30 printf( '<p>' . __( '<strong>Zip file:</strong> %s', 'wporg-plugins' ) . '</p>', 30 $zip_size = ( is_object( $zip_file ) ? size_format( filesize( get_attached_file( $zip_file->ID ) ), 1 ) : __( 'unknown size', 'wporg-plugins' ) ); 31 printf( 32 '<p>' . __( '<strong>Zip file:</strong> %s', 'wporg-plugins' ) . '</p>', 31 33 sprintf( '%s <a href="%s">%s</a> (%s)', esc_html( $zip_date ), esc_url( $zip_url ), esc_html( $zip_url ), esc_html( $zip_size ) ) 32 34 ); … … 65 67 $subject = sprintf( __( '[WordPress Plugin Directory] Notice: %s', 'wporg-plugins' ), $post->post_title ); 66 68 } 67 69 68 70 ?> 69 71 <form id="contact-author" class="contact-author" method="POST" action="https://supportpress.wordpress.org/plugins/thread-new.php"> … … 75 77 </form> 76 78 <?php 79 77 80 return $string; 78 81 } );
Note: See TracChangeset
for help on using the changeset viewer.