Making WordPress.org

Changeset 11542


Ignore:
Timestamp:
02/10/2022 04:56:58 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: API: Restore the Contributors field properly.

Props kraftbj.
See [11535], #6032.

File:
1 edited

Legend:

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

    r11535 r11542  
    151151     * Removes any extra fields which the API client doesn't need to be sent.
    152152     *
    153      * @param array  $response The plugin_information response to remove fields from
    154      * @param mixed  $request  The request object for the request.
    155      * @param string $method   The requested method, used to determine the default fields to include.
     153     * @param array  $full_response The plugin_information response to remove fields from
     154     * @param mixed  $request       The request object for the request.
     155     * @param string $method        The requested method, used to determine the default fields to include.
    156156     *
    157157     * @return array The $response with the extra fields removed.
     
    179179        // WordPress 4.9 and older need a "bare" contributor map [ user => profile ]
    180180        if ( ! empty( $fields['bare_contributors'] ) ) {
    181             $contributors             = $response['contributors'] ?? [];
     181            $contributors             = $full_response['contributors'] ?? [];
    182182            $response['contributors'] = array();
    183183            foreach ( $contributors as $user => $data ) {
Note: See TracChangeset for help on using the changeset viewer.