Changeset 6225 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
- Timestamp:
- 12/03/2017 09:41:48 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/plugin-single.php
r6212 r6225 18 18 19 19 ?><article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 20 <?php echo Template::get_plugin_banner( get_post(), 'html' ); ?> 20 <?php 21 // Don't show the plugin banner for closed plugins 22 if ( ! in_array( $status, array( 'closed', 'disabled' ) ) ) { 23 echo Template::get_plugin_banner( get_post(), 'html' ); 24 } 25 ?> 21 26 22 27 <header class="plugin-header"> … … 24 29 <div class="plugin-notice notice notice-warning notice-alt"> 25 30 <p><?php _e( 'This plugin <strong>hasn’t been updated in over 2 years</strong>. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.', 'wporg-plugins' ); ?></p> 26 </div> <!-- .plugin-notice -->31 </div> 27 32 <?php endif; ?> 28 33 <?php if ( 'publish' !== $status ) : … … 66 71 } 67 72 } 73 74 if ( ! in_array( $status, array( 'closed', 'disabled' ) ) ) { 75 // the notice for closed and disabled is shown below the Description header, because we don't output the readme there 68 76 ?> 77 <!-- .plugin-notice --> 69 78 <div class="plugin-notice notice <?php echo esc_attr( $notice_type ); ?> notice-alt"> 70 79 <p><?php echo $message; ?></p> 71 </div><!-- .plugin-notice --> 72 73 <?php if ( in_array( $status, array( 'closed', 'disabled' ) ) && get_current_user_id() == get_post()->post_author ) : ?> 74 <div class="plugin-notice notice notice-info notice-alt"> 75 <p><?php 76 printf( 77 /* translators: 1: plugins@wordpress.org */ 78 __( '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' ), 79 'plugins@wordpress.org' 80 ); 81 ?></p> 82 </div><!-- .plugin-notice --> 83 <?php endif; ?> 80 </div> 81 <!-- .plugin-notice --> 82 <?php } ?> 84 83 <?php endif; ?> 85 84 86 85 <div class="entry-thumbnail"> 87 <?php echo Template::get_plugin_icon( get_post(), 'html' ); ?> 86 <?php 87 // Don't show the icon for closed plugins 88 if ( ! in_array( $status, array( 'closed', 'disabled' ) ) ) { 89 echo Template::get_plugin_icon( get_post(), 'html' ); 90 } 91 ?> 88 92 </div> 89 93 … … 124 128 <?php endif; ?> 125 129 </div> 126 127 <?php the_title( '<h1 class="plugin-title"><a href="' . esc_url( get_permalink() ) . '">', '</a></h1>' ); ?> 130 131 <?php 132 if ( in_array( $status, array( 'closed', 'disabled' ) ) ) { 133 add_filter( 'the_title', function( $title, $id ) { 134 $post = get_post( $id ); 135 return $post->post_name; 136 }, 10, 2 ); 137 } 138 the_title( '<h1 class="plugin-title"><a href="' . esc_url( get_permalink() ) . '">', '</a></h1>' ); ?> 128 139 129 140 <span class="byline"><?php … … 150 161 <li id="tablink-description"><a href='#description'><?php _e( 'Details', 'wporg-plugins' ); ?></a></li> 151 162 <li id="tablink-reviews"><a href='#reviews'><?php _e( 'Reviews', 'wporg-plugins' ); ?></a></li> 152 <?php if ( isset( $content[ 'installation' ] ) ) { ?>163 <?php if ( isset( $content[ 'installation' ] ) && ! in_array( $status, array( 'closed', 'disabled' ) ) ) { ?> 153 164 <li id="tablink-installation"><a href='#installation'><?php _e( 'Installation', 'wporg-plugins' ); ?></a></li> 154 165 <?php } ?> … … 169 180 } 170 181 171 $section_content = trim( apply_filters( 'the_content', $content[ $section_slug ], $section_slug ) ); 182 if ( 'description' === $section_slug && in_array( $status, array( 'closed', 'disabled' ) ) ) { 183 // Don't show the description for closed plugins 184 $section_content = '<div class="plugin-notice notice notice-error notice-alt"><p>' . $message . '</p></div>'; 185 if ( get_current_user_id() == get_post()->post_author ) { 186 $section_content .= '<div class="plugin-notice notice notice-info notice-alt"><p>' . 187 sprintf( 188 /* translators: 1: plugins@wordpress.org */ 189 __( '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' ), 190 'plugins@wordpress.org' 191 ) . '</p></div><!-- .plugin-notice -->'; 192 } 193 } 194 else if ( in_array( $section_slug, array( 'screenshots', 'installation', 'faq', 'changelog' ) ) && in_array( $status, array( 'closed', 'disabled' ) ) ) { 195 $section_content = ''; 196 } 197 else { 198 $section_content = trim( apply_filters( 'the_content', $content[ $section_slug ], $section_slug ) ); 199 } 200 172 201 if ( empty( $section_content ) ) { 173 202 continue;
Note: See TracChangeset
for help on using the changeset viewer.