Changeset 14152
- Timestamp:
- 10/29/2024 02:31:15 AM (7 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
r13645 r14152 62 62 'description' => $close_text, 63 63 'closed' => true, 64 'closed_date' => $close_data['date'] ? : false,64 'closed_date' => $close_data['date'] ? gmdate( 'Y-m-d', strtotime( $close_data['date'] ) ) : false, 65 65 'reason' => $close_data['public'] ? $close_data['reason'] : false, 66 66 'reason_text' => $close_data['public'] ? $close_data['label'] : false, -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r14075 r14152 1091 1091 } 1092 1092 1093 $result['label'] = self::get_close_reasons()[ $result['reason'] ] ?? _x( 'Unknown', 'unknown close reason', 'wporg-plugins' ); 1094 $days_closed = $result['date'] ? (int) ( ( time() - strtotime( $result['date'] ) ) / DAY_IN_SECONDS ) : false; 1093 $result['label'] = self::get_close_reasons()[ $result['reason'] ] ?? false; 1094 1095 // If not known reason, use 'unknown'. 1096 if ( ! $result['label'] ) { 1097 $result['reason'] = 'unknown'; 1098 $result['label'] = _x( 'Unknown', 'unknown close reason', 'wporg-plugins' ); 1099 } 1095 1100 1096 1101 // If it's closed for more than 60 days, it's by author request, or we're unsure about the close date, it's publicly known. 1102 $days_closed = $result['date'] ? (int) ( ( time() - strtotime( $result['date'] ) ) / DAY_IN_SECONDS ) : false; 1097 1103 if ( ! $result['date'] || $days_closed >= 60 || 'author-request' === $result['reason'] ) { 1098 1104 $result['public'] = true; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-api-update-updater.php
r13628 r14152 83 83 84 84 if ( in_array( $post->post_status, array( 'disabled', 'closed' ) ) ) { 85 $closed_data = Template::get_close_data( $post ); 86 $meta['closed_at'] = $closed_data['date'] ?? false; 87 if ( $closed_data['public'] ?? false ) { 88 $meta['closed_reason'] = $closed_data['reason']; 89 $meta['closed_label'] = $closed_data['label']; 85 $closed_data = Template::get_close_data( $post ); 86 if ( $closed_data ) { 87 // Close date is sometimes unknown, only include the Day of closure. 88 $meta['closed_at'] = $closed_data['date'] ? gmdate( 'Y-m-d', strtotime( $closed_data['date'] ) ) : false; 89 if ( $closed_data['public'] ) { 90 $meta['closed_reason'] = $closed_data['reason'] ?: 'unknown'; 91 $meta['closed_label'] = $closed_data['label']; 92 } 90 93 } 91 94 }
Note: See TracChangeset
for help on using the changeset viewer.