Changeset 12175 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php
- Timestamp:
- 11/01/2022 05:41:04 AM (3 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
r12166 r12175 113 113 ] ); 114 114 115 if ( in_array( $post->post_status, [ 'draft', 'pending', 'new' ], true ) ) {116 117 $zip_files = array();118 foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) {119 $zip_files[ $zip_file->post_date ] = array( wp_get_attachment_url( $zip_file->ID ), $zip_file ); 120 }115 $zip_files = array(); 116 foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) { 117 $zip_files[ $zip_file->post_date ] = array( wp_get_attachment_url( $zip_file->ID ), $zip_file ); 118 } 119 120 if ( $zip_files ) { 121 121 uksort( $zip_files, function ( $a, $b ) { 122 122 return strtotime( $a ) < strtotime( $b ); 123 123 } ); 124 125 $zip_url = get_post_meta( $post->ID, '_submitted_zip', true );126 if ( $zip_url ) {127 // Back-compat only.128 $zip_files['User provided URL'] = array( $zip_url, null );129 }130 124 131 125 echo '<p><strong>Zip files:</strong></p>'; … … 133 127 foreach ( $zip_files as $zip_date => $zip ) { 134 128 list( $zip_url, $zip_file ) = $zip; 135 $zip_size = is_object( $zip_file ) ? size_format( filesize( get_attached_file( $zip_file->ID ) ), 1 ) : 'unknown size'; 136 137 printf( '<li>%s <a href="%s">%s</a> (%s)</li>', esc_html( $zip_date ), esc_url( $zip_url ), esc_html( $zip_url ), esc_html( $zip_size ) ); 129 $zip_size = size_format( filesize( get_attached_file( $zip_file->ID ) ), 1 ); 130 131 printf( 132 '<li>%1$s <a href="%2$s">%3$s</a> (%4$s)</li>', 133 esc_html( $zip_date ), 134 esc_url( $zip_url ), 135 esc_html( basename( $zip_url ) ), 136 esc_html( $zip_size ) 137 ); 138 138 } 139 139 echo '</ul>'; 140 140 } 141 142 if ( in_array( $post->post_status, [ 'draft', 'pending', 'new' ], true ) ) { 141 143 $slug_restricted = []; 142 144 $slug_reserved = [];
Note: See TracChangeset
for help on using the changeset viewer.