Changeset 6251 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section-advanced.php
- Timestamp:
- 12/08/2017 05:37:23 PM (7 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
r6249 r6251 9 9 10 10 namespace WordPressdotorg\Plugin_Directory\Theme; 11 use WordPressdotorg\Plugin_Directory\Plugin_Directory;12 11 use WordPressdotorg\Plugin_Directory\Template; 12 13 global $post; 13 14 ?> 14 15 15 16 <div id="admin" class="section"> 16 <?php 17 $status = get_post_status(); 18 if ( in_array( $status, array( 'closed', 'disabled' ) ) ) { 19 echo '<div class="plugin-notice notice notice-error notice-alt"><p>' . __( 'This plugin has been closed and is no longer available for download.', 'wporg-plugins' ) . '</p></div>'; 20 if ( get_current_user_id() == get_post()->post_author ) { 21 echo '<div class="plugin-notice notice notice-info notice-alt"><p>' . 22 sprintf( 23 /* translators: 1: plugins@wordpress.org */ 24 __( 'If you did not request this change, please contact <a href="mailto:%1$s">%1$s</a> for a status. All developers with commit access are contacted when a plugin is closed, with the reasons why, so check your spam email too.', 'wporg-plugins' ), 25 'plugins@wordpress.org' 26 ) . '</p></div><!-- .plugin-notice -->'; 27 } 28 } 17 <?php the_closed_plugin_notice(); ?> 29 18 30 ?>31 19 <h2><?php _e( 'Plugin Stats', 'wporg-plugins' ); ?></h2> 32 20 … … 46 34 47 35 <?php 48 36 if ( 'publish' === $post->post_status ) { 49 37 $tags = (array) get_post_meta( $post->ID, 'tagged_versions', true ); 50 // Sort the versions by version 38 // Sort the versions by version. 51 39 usort( $tags, 'version_compare' ); 52 // We'll want to add a Development Version if it exists 40 // We'll want to add a Development Version if it exists. 53 41 $tags[] = 'trunk'; 54 42 … … 59 47 $tags = array_reverse( $tags ); 60 48 61 if ( $tags && 'publish' === get_post_status() ) {62 echo '<h5>' . __( 'Previous Versions', 'wporg-plugins' ) . '</h5>';49 echo '<h5>' . __( 'Previous Versions', 'wporg-plugins' ) . '</h5>'; 50 echo '<div class="plugin-notice notice notice-info notice-alt"><p>' . __( 'Previous versions of this plugin may not be secure or stable and are available for testing purposes only.', 'wporg-plugins' ) . '</p></div>'; 63 51 64 echo '<div class="plugin-notice notice notice-info notice-alt"><p>' . __( 'Previous versions of this plugin may not be secure or stable and are available for testing purposes only.', 'wporg-plugins' ) . '</p></div>'; 52 echo '<select class="previous-versions" onchange="getElementById(\'download-previous-link\').href=this.value;">'; 53 foreach ( $tags as $version ) { 54 $text = ( 'trunk' == $version ? __( 'Development Version', 'wporg-plugins' ) : $version ); 55 printf( '<option value="%s">%s</option>', esc_attr( Template::download_link( $post, $version ) ), esc_html( $text ) ); 56 } 57 echo '</select> '; 65 58 66 echo '<select class="previous-versions" onchange="getElementById(\'download-previous-link\').href=this.value;">'; 67 foreach ( $tags as $version ) { 68 $text = ( 'trunk' == $version ? __( 'Development Version', 'wporg-plugins' ) : $version ); 69 printf( '<option value="%s">%s</option>', esc_attr( Template::download_link( $post, $version ) ), esc_html( $text ) ); 70 } 71 echo '</select> '; 72 73 printf( 74 '<a href="%s" id="download-previous-link" class="button">%s</a>', 75 esc_url( Template::download_link( $post, reset( $tags ) ) ), 76 __( 'Download', 'wporg-plugins' ) 77 ); 78 } 79 59 printf( 60 '<a href="%s" id="download-previous-link" class="button">%s</a>', 61 esc_url( Template::download_link( $post, reset( $tags ) ) ), 62 __( 'Download', 'wporg-plugins' ) 63 ); 64 } 80 65 ?> 81 66 </div>
Note: See TracChangeset
for help on using the changeset viewer.