Making WordPress.org


Ignore:
Timestamp:
04/30/2024 05:26:07 AM (5 months ago)
Author:
dd32
Message:

Plugin Directory: Expose the plugin closed status through the plugin_information API endpoint.

This only applies to v1.2+ clients, as v1.0/1.1 expect a null response for any error case.

See #7057.

File:
1 edited

Legend:

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

    r13106 r13620  
    137137        }
    138138
    139         // Only include the fields requested.
    140         $response = $this->remove_unexpected_fields( $response, $request, 'plugin_information' );
     139        // Only include the fields requested. If an error is present, we ignore the requested fields.
     140        if ( ! isset( $response['error'] ) ) {
     141            $response = $this->remove_unexpected_fields( $response, $request, 'plugin_information' );
     142        }
    141143
    142144        $this->output( (object) $response );
     
    256258                ), true
    257259            );
     260
     261            // Don't include unknown plugins OR closed plugins.
    258262            if ( isset( $plugin['error'] ) ) {
    259263                unset( $response['plugins'][ $i ] );
Note: See TracChangeset for help on using the changeset viewer.