Changeset 3230 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php
- Timestamp:
- 05/24/2016 04:01:00 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php
r2640 r3230 8 8 */ 9 9 public static function display() { 10 ob_start(); 11 10 12 if ( is_user_logged_in() ) : 11 13 12 if ( ! empty( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'wporg-plugins-upload' ) && 'upload' === $_POST['action'] ) {13 if ( UPLOAD_ERR_OK === $_FILES['zip_file']['error'] ) {14 if ( ! empty( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'wporg-plugins-upload' ) && 'upload' === $_POST['action'] ) : 15 if ( UPLOAD_ERR_OK === $_FILES['zip_file']['error'] ) : 14 16 $uploader = new Upload_Handler; 15 17 $message = $uploader->process_upload(); 16 } else {18 else : 17 19 $message = __( 'Error in file upload.', 'wporg-plugins' ); 18 }20 endif; 19 21 20 if ( ! empty( $message ) ) { 21 echo "<div class='notice notice-warning'><p>{$message}</p></div>\n"; 22 } 23 } 24 ?> 22 if ( ! empty( $message ) ) : 23 echo "<div class='notice notice-warning notice-alt'><p>{$message}</p></div>\n"; 24 endif; 25 26 else : 27 $plugins = wp_count_posts( 'plugin', 'readable' ); 28 ?> 29 30 <div class="plugin-queue-message notice notice-info notice-alt"> 31 <p> 32 <?php 33 printf( _n( 'Currently there is %1$s plugin in the review queue.', 'Currently there are %1$s plugins in the review queue, %2$s of which are awaiting their initial review.', ( $plugins->draft + $plugins->pending ), 'wporg-plugins' ), 34 '<strong>' . ( $plugins->draft + $plugins->pending ) . '</strong>', 35 '<strong>' . $plugins->draft . '</strong>' 36 ); 37 ?> 38 </p> 39 </div> 40 41 <?php endif; ?> 42 25 43 <form enctype="multipart/form-data" id="upload_form" method="POST" action=""> 26 44 <?php wp_nonce_field( 'wporg-plugins-upload' ); ?> … … 33 51 </p> 34 52 </form> 53 35 54 <?php else : ?> 36 <p><?php printf( __( 'Before you can upload a new plugin, <a href="%s">please log in</a>.', 'wporg-plugins' ), esc_url( 'https://login.wordpress.org/' ) ); ?> 37 </p> 55 56 <p><?php printf( __( 'Before you can upload a new plugin, <a href="%s">please log in</a>.', 'wporg-plugins' ), esc_url( 'https://login.wordpress.org/' ) ); ?></p> 57 38 58 <?php endif; 59 60 return ob_get_clean(); 39 61 } 40 62
Note: See TracChangeset
for help on using the changeset viewer.