Making WordPress.org

Changeset 811


Ignore:
Timestamp:
08/25/2014 08:33:54 PM (11 years ago)
Author:
nacin
Message:

Translations: Add theme and plugin endpoints.

Location:
sites/trunk/api.wordpress.org/public_html/translations
Files:
4 added
2 copied

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/translations/plugins/1.0/index.php

    r809 r811  
    88wp_cache_init();
    99
    10 $version = isset( $_REQUEST['version'] ) ? $_REQUEST['version'] : WP_CORE_LATEST_RELEASE;
     10$slug = isset( $_REQUEST['slug'] ) ? $_REQUEST['slug'] : '';
     11$version = isset( $_REQUEST['version'] ) ? $_REQUEST['version'] : null;
    1112
    12 $translations = find_all_translations_for_core( $version );
     13$translations = find_all_translations_for_type_and_domain( 'plugin', $slug, $version );
    1314
    1415call_headers( 'application/json' );
    1516
    16 if ( version_compare( $version, '4.0-alpha-29017-src', '>=' ) ) {
    17     echo json_encode( array( 'translations' => $translations ) );
    18 } else {
    19     echo json_encode( array( 'languages' => $translations ) );
    20 }
     17echo json_encode( array( 'translations' => $translations ) );
    2118
    2219exit;
  • sites/trunk/api.wordpress.org/public_html/translations/themes/1.0/index.php

    r809 r811  
    88wp_cache_init();
    99
    10 $version = isset( $_REQUEST['version'] ) ? $_REQUEST['version'] : WP_CORE_LATEST_RELEASE;
     10$slug = isset( $_REQUEST['slug'] ) ? $_REQUEST['slug'] : '';
     11$version = isset( $_REQUEST['version'] ) ? $_REQUEST['version'] : null;
    1112
    12 $translations = find_all_translations_for_core( $version );
     13$translations = find_all_translations_for_type_and_domain( 'theme', $slug, $version );
    1314
    1415call_headers( 'application/json' );
    1516
    16 if ( version_compare( $version, '4.0-alpha-29017-src', '>=' ) ) {
    17     echo json_encode( array( 'translations' => $translations ) );
    18 } else {
    19     echo json_encode( array( 'languages' => $translations ) );
    20 }
     17echo json_encode( array( 'translations' => $translations ) );
    2118
    2219exit;
Note: See TracChangeset for help on using the changeset viewer.