Making WordPress.org

Ticket #7405: 7405.diff

File 7405.diff, 2.5 KB (added by dd32, 13 months ago)
  • shortcodes/class-upload.php

     
    11<?php
    22namespace WordPressdotorg\Plugin_Directory\Shortcodes;
     3use WordPressdotorg\Plugin_Directory\Template;
    34
    45class Upload {
    56
    67        /**
    78         * Retrieves plugins in the queue submitted by the current user.
    89         *
    910         * @return array An array of user's plugins, and counts of it.
    1011         */
    1112        public static function get_submitted_plugins() {
    1213                $plugins = get_posts( array(
    1314                        'post_type'      => 'plugin',
    1415                        'post_status'    => array( 'new', 'pending', 'approved' ),
    1516                        'author'         => get_current_user_id(),
    1617                        'orderby'        => 'title',
    1718                        'order'          => 'ASC',
    class Upload { 
    272273                                                                        </form>
    273274                                                                </dialog>
    274275                                                        <?php
    275276                                                        endif; // $can_change_slug
    276277                                                        echo '</li>';
    277278
    278279                                                        echo '<li>';
    279280                                                        $attached_media = get_attached_media( 'application/zip', $plugin );
    280281
    281282                                                        echo '<strong>' . __( 'Submitted files:', 'wporg' ) . '</strong><ol>';
    282283                                                        foreach ( $attached_media as $upload ) {
    283284                                                                echo '<li><ul>';
    284285                                                                echo '<li><code>' . esc_html( $upload->submitted_name ) . '</code></li>';
    285286                                                                echo '<li>' . sprintf( __( 'Version: %s', 'wporg-plugins' ), '<code>' . esc_html( $upload->version ) . '</code>' ) . '</li>';
    286287                                                                echo '<li>' . sprintf( __( 'Upload Date: %s', 'wporg-plugins' ), date_i18n( get_option( 'date_format' ), strtotime( $upload->post_date ) ) ) . '</li>';
     288                                                                printf(
     289                                                                        '<li><a href="%s">%s</a></li>',
     290                                                                        esc_url( Template::preview_link_zip( $plugin->post_name, $upload->ID, 'pcp' ) ),
     291                                                                        __( 'Check with Plugin Check', 'wporg-plugins' )
     292                                                                );
    287293                                                                echo '</ul></li>';
    288294                                                        }
    289295                                                        if ( $can_upload_extras ) {
    290296                                                                echo '<li class="unmarked-list"><a href="#" class="show-upload-additional hide-if-no-js">' . sprintf( __( 'Upload new version of %s for review.', 'wporg-plugins' ), esc_html( $plugin->post_title ) ) . '</a>';
    291297                                                        }
    292298                                                        echo '</ol>';
    293299
    294300                                                        if ( $can_upload_extras ) {
    295301                                                                ?>
    296302                                                                <form class="plugin-upload-form hidden" enctype="multipart/form-data" method="POST" action="">
    297303                                                                        <?php wp_nonce_field( 'wporg-plugins-upload-' . $plugin->ID ); ?>
    298304                                                                        <input type="hidden" name="action" value="upload-additional"/>
    299305                                                                        <input type="hidden" name="plugin_id" value="<?php echo esc_attr( $plugin->ID ); ?>" />
    300306
    301307                                                                        <label class="button button-secondary zip-file">