Changeset 5249
- Timestamp:
- 04/05/2017 05:13:26 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section-advanced.php
r5248 r5249 26 26 <tbody></tbody> 27 27 </table> 28 29 <?php 30 31 $tags = (array) get_post_meta( $post->ID, 'tagged_versions', true ); 32 // Sort the versions by version 33 usort( $tags, 'version_compare' ); 34 // We'll want to add a Development Version if it exists 35 $tags[] = 'trunk'; 36 37 // Remove the current version, this may be trunk. 38 $tags = array_diff( $tags, array( get_post_meta( $post->ID, 'stable_tag', true ) ) ); 39 40 // List Trunk, followed by the most recent non-stable release. 41 $tags = array_reverse( $tags ); 42 43 if ( $tags ) { 44 echo '<h5>' . __( 'Previous Versions', 'wporg-plugins' ) . '</h5>'; 45 46 echo '<select id="prevous-versions" onchange="getElementById(\'download-previous-link\').href=this.value;">'; 47 foreach ( $tags as $version ) { 48 $text = ( 'trunk' == $version ? __( 'Development Version', 'wporg-plugins' ) : $version ); 49 printf( '<option value="%s">%s</option>', esc_attr( Template::download_link( $post, $version ) ), esc_html( $text ) ); 50 } 51 echo '</select> '; 52 53 printf( 54 '<a href="%s" id="download-previous-link" class="button">%s</a>', 55 esc_url( Template::download_link( $post, reset( $tags ) ) ), 56 __( 'Download', 'wporg-plugins' ) 57 ); 58 } 59 60 ?> 28 61 </div>
Note: See TracChangeset
for help on using the changeset viewer.