WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/30/2013 07:46:15 PM (8 years ago)
Author:
nacin
Message:

Send back core translation information to the API. Update wp_get_installed_translations() to work with core translations. see #18200.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/update.php

    r25649 r25652  
    2929
    3030    $current = get_site_transient( 'update_core' );
     31    $translations = wp_get_installed_translations( 'core' );
     32
    3133    if ( ! is_object($current) ) {
    3234        $current = new stdClass;
     
    8688            'wp_install' => $wp_install,
    8789            'wp_blog' => home_url( '/' )
    88         )
     90        ),
     91        'body' => array(
     92            'translations' => json_encode( $translations ),
     93        ),
    8994    );
    9095
    91     $response = wp_remote_get($url, $options);
     96    $response = wp_remote_post( $url, $options );
    9297
    9398    if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
     
    120125    $updates->last_checked = time();
    121126    $updates->version_checked = $wp_version;
     127
     128    if ( isset( $body['translations'] ) )
     129        $updates->translations = $body['translations'];
     130
    122131    set_site_transient( 'update_core',  $updates);
    123132}
Note: See TracChangeset for help on using the changeset viewer.