Changeset 13620 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/inc/template-tags.php
- Timestamp:
- 04/30/2024 05:26:07 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/inc/template-tags.php
r13600 r13620 209 209 case 'disabled': 210 210 case 'closed': 211 $closed_date = get_post_meta( get_the_ID(), 'plugin_closed_date', true ); 212 $close_reason = Template::get_close_reason( $post ); 213 214 if ( $closed_date ) { 211 $close_data = Template::get_close_data( $post ); 212 213 if ( $close_data['date'] ) { 215 214 if ( 'disabled' === $post_status && current_user_can( 'plugin_approve' ) ) { 216 /* translators: %s: plugin closing date */ 217 $message = sprintf( __( 'This plugin has been disabled as of %s -- this means it is closed, but actively serving updates.', 'wporg-plugins' ), mysql2date( get_option( 'date_format' ), $closed_date ) ); 215 $message = sprintf( 216 /* translators: %s: plugin closing date */ 217 __( 'This plugin has been disabled as of %s -- this means it is closed, but actively serving updates.', 'wporg-plugins' ), 218 mysql2date( get_option( 'date_format' ), $close_data['date'] ) 219 ); 218 220 } else { 219 /* translators: %s: plugin closing date */ 220 $message = sprintf( __( 'This plugin has been closed as of %s and is not available for download.', 'wporg-plugins' ), mysql2date( get_option( 'date_format' ), $closed_date ) ); 221 $message = sprintf( 222 /* translators: %s: plugin closing date */ 223 __( 'This plugin has been closed as of %s and is not available for download.', 'wporg-plugins' ), 224 mysql2date( get_option( 'date_format' ), $close_data['date'] ) 225 ); 221 226 } 222 227 223 // Determine permanence of closure.224 $committers = Tools::get_plugin_committers( $post->post_name );225 $permanent = ( __( 'Author Request', 'wporg-plugins' ) === $close_reason || ! $committers );226 227 $days_passed = (int) ( ( current_time( 'timestamp' ) - mysql2date( 'U', $closed_date ) ) / DAY_IN_SECONDS );228 229 228 // If we're closed, it may be permanent. 230 if ( $ permanent) {229 if ( $close_data['permanent'] ) { 231 230 $message .= ' ' . __( 'This closure is permanent.', 'wporg-plugins' ); 232 } elseif ( $days_passed < 60) {231 } elseif ( ! $close_data['public'] ) { 233 232 $message .= ' ' . __( 'This closure is temporary, pending a full review.', 'wporg-plugins' ); 234 233 } 235 234 236 // Display close reason if more than 60 days have passed.237 if ( $ days_passed >= 60) {235 // Display close reason if it's now publicly known. 236 if ( $close_data['public'] && $close_data['reason'] ) { 238 237 /* translators: %s: plugin close/disable reason */ 239 $message .= ' ' . sprintf( __( 'Reason: %s.', 'wporg-plugins' ), $close_ reason);238 $message .= ' ' . sprintf( __( 'Reason: %s.', 'wporg-plugins' ), $close_data['label'] ); 240 239 } 241 240 } else {
Note: See TracChangeset
for help on using the changeset viewer.