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/jobs/class-api-update-updater.php

    r13628 r14152  
    8383
    8484        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                }
    9093            }
    9194        }
Note: See TracChangeset for help on using the changeset viewer.