Making WordPress.org


Ignore:
Timestamp:
01/30/2018 03:18:52 AM (8 years ago)
Author:
dd32
Message:

Theme Directory: API: Move the Themes_API class into the plugin, making api.wordpress.org/themes/info/ a wrapper for it.

See #1630

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/themes/info/1.0/index.php

    r6418 r6462  
    99if ( defined( 'JSON_RESPONSE' ) && JSON_RESPONSE ) {
    1010    $request = isset( $_REQUEST['request'] ) ? (object) wp_unslash( $_REQUEST['request'] ) : '';
     11    $format = 'json';
    1112} else {
    1213    $post_request = isset( $_POST['request'] ) ? urldecode( wp_unslash( $_POST['request'] ) ) : '';
     
    1617
    1718    $request = unserialize( $post_request );
     19
     20    $format = 'php';
    1821}
     22
    1923$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
    2024
    21 // Load the Themes API.
    22 if ( ! class_exists( 'Themes_API' ) ) {
    23     require_once __DIR__ . '/class-themes-api.php';
    24 }
    25 
    26 // Instantiate the API and serve the result.
    27 $api = new Themes_API( $action, $request );
    28 echo $api->get_result();
     25// Serve an API request.
     26echo wporg_themes_query_api( $action, $request, $format );
Note: See TracChangeset for help on using the changeset viewer.