Making WordPress.org


Ignore:
Timestamp:
10/29/2024 02:31:15 AM (16 months ago)
Author:
dd32
Message:

Plugin Directory: Standardise on the data exposed for closed plugins.

See #7057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php

    r14075 r14152  
    10911091        }
    10921092
    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        }
    10951100
    10961101        // 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;
    10971103        if ( ! $result['date'] || $days_closed >= 60 || 'author-request' === $result['reason'] ) {
    10981104            $result['public'] = true;
Note: See TracChangeset for help on using the changeset viewer.