Making WordPress.org

Changeset 6486


Ignore:
Timestamp:
01/31/2018 04:17:58 AM (7 years ago)
Author:
dd32
Message:

API: Plugin & Theme Directory: Use the new constants to determine which API version we're running on.

See #111

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins
Files:
2 edited

Legend:

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

    r6485 r6486  
    125125        }
    126126
    127         // Backwards compatibility; the API returns null in case of error..
    128         // This is now feature-flagged by the PLUGINS_API_SUPPORTS_ERRORS constant which is defined as `true` in info/1.2 and later.
    129         if ( isset( $response['error'] ) && ( defined( 'PLUGINS_API_SUPPORTS_ERRORS' ) && ! PLUGINS_API_SUPPORTS_ERRORS ) ) {
     127        // Backwards compatibility; the API returns null in case of error for the 1.0/1.1 API endpoints.
     128        if ( isset( $response['error'] ) && defined( 'PLUGINS_API_VERSION' ) && PLUGINS_API_VERSION < 1.2 ) {
    130129            $this->output( null );
    131130            return;
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php

    r6484 r6486  
    121121        $response = $this->response;
    122122
    123         // Back-compat behaviour:
    124         if ( defined( 'THEMES_API_SUPPORTS_ERRORS' ) && ! THEMES_API_SUPPORTS_ERRORS ) {
     123        // Back-compat behaviour for the 1.0/1.1 API's
     124        if ( defined( 'THEMES_API_VERSION' ) && THEMES_API_VERSION < 1.2 ) {
    125125            if ( isset( $this->response->error ) && 'Theme not found' == $this->response->error ) {
    126126                $response = false;
Note: See TracChangeset for help on using the changeset viewer.