Making WordPress.org

Ticket #3368: 3368.diff

File 3368.diff, 2.4 KB (added by swissspidy, 6 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section-advanced.php

     
    4646
    4747                // List Trunk, followed by the most recent non-stable release.
    4848                $tags = array_reverse( $tags );
     49                if ( ! empty( $tags ) ) {
     50                        echo '<h5>' . esc_html__( 'Previous Versions', 'wporg-plugins' ) . '</h5>';
     51                        echo '<div class="plugin-notice notice notice-info notice-alt"><p>' . esc_html__( 'Previous versions of this plugin may not be secure or stable and are available for testing purposes only.', 'wporg-plugins' ) . '</p></div>';
    4952
    50                 echo '<h5>' . esc_html__( 'Previous Versions', 'wporg-plugins' ) . '</h5>';
    51                 echo '<div class="plugin-notice notice notice-info notice-alt"><p>' . esc_html__( 'Previous versions of this plugin may not be secure or stable and are available for testing purposes only.', 'wporg-plugins' ) . '</p></div>';
     53                        echo '<select class="previous-versions" onchange="getElementById(\'download-previous-link\').href=this.value;">';
     54                        foreach ( $tags as $version ) {
     55                                $text = ( 'trunk' === $version ? esc_html__( 'Development Version', 'wporg-plugins' ) : $version );
     56                                printf( '<option value="%s">%s</option>', esc_attr( Template::download_link( $post, $version ) ), esc_html( $text ) );
     57                        }
     58                        echo '</select> ';
    5259
    53                 echo '<select class="previous-versions" onchange="getElementById(\'download-previous-link\').href=this.value;">';
    54                 foreach ( $tags as $version ) {
    55                         $text = ( 'trunk' === $version ? esc_html__( 'Development Version', 'wporg-plugins' ) : $version );
    56                         printf( '<option value="%s">%s</option>', esc_attr( Template::download_link( $post, $version ) ), esc_html( $text ) );
     60                        printf(
     61                                '<a href="%s" id="download-previous-link" class="button">%s</a>',
     62                                esc_url( Template::download_link( $post, reset( $tags ) ) ),
     63                                esc_html__( 'Download', 'wporg-plugins' )
     64                        );
    5765                }
    58                 echo '</select> ';
    59 
    60                 printf(
    61                         '<a href="%s" id="download-previous-link" class="button">%s</a>',
    62                         esc_url( Template::download_link( $post, reset( $tags ) ) ),
    63                         esc_html__( 'Download', 'wporg-plugins' )
    64                 );
    6566        }
    6667        ?>
    6768</div>