mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
Send back core translation information to the API. Update wp_get_installed_translations() to work with core translations. see #18200.
git-svn-id: https://develop.svn.wordpress.org/trunk@25652 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -28,6 +28,8 @@ function wp_version_check() {
|
||||
$php_version = phpversion();
|
||||
|
||||
$current = get_site_transient( 'update_core' );
|
||||
$translations = wp_get_installed_translations( 'core' );
|
||||
|
||||
if ( ! is_object($current) ) {
|
||||
$current = new stdClass;
|
||||
$current->updates = array();
|
||||
@@ -85,10 +87,13 @@ function wp_version_check() {
|
||||
'headers' => array(
|
||||
'wp_install' => $wp_install,
|
||||
'wp_blog' => home_url( '/' )
|
||||
)
|
||||
),
|
||||
'body' => array(
|
||||
'translations' => json_encode( $translations ),
|
||||
),
|
||||
);
|
||||
|
||||
$response = wp_remote_get($url, $options);
|
||||
$response = wp_remote_post( $url, $options );
|
||||
|
||||
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
|
||||
return false;
|
||||
@@ -119,6 +124,10 @@ function wp_version_check() {
|
||||
$updates->updates = $offers;
|
||||
$updates->last_checked = time();
|
||||
$updates->version_checked = $wp_version;
|
||||
|
||||
if ( isset( $body['translations'] ) )
|
||||
$updates->translations = $body['translations'];
|
||||
|
||||
set_site_transient( 'update_core', $updates);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user