Filters for locale in wp_update_plugins() and wp_update_themes(). see #18200.

Built from https://develop.svn.wordpress.org/trunk@25634


git-svn-id: http://core.svn.wordpress.org/trunk@25551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-09-28 04:18:12 +00:00
parent 00d2c39c48
commit f092346465
1 changed files with 20 additions and 2 deletions

View File

@ -203,12 +203,21 @@ function wp_update_plugins() {
$to_send = compact( 'plugins', 'active' );
/**
* Filter the locales requested for plugin translations.
*
* @since 3.7.0
*
* @param array $locales Defaults to the current locale of the site.
*/
$locales = apply_filters( 'plugins_update_check_locales', array( get_locale() ) );
$options = array(
'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
'body' => array(
'plugins' => json_encode( $to_send ),
'translations' => json_encode( $translations ),
'locale' => json_encode( array( get_locale() ) ), // @todo filter.
'locale' => json_encode( $locales ),
),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
@ -329,12 +338,21 @@ function wp_update_themes() {
$request['themes'] = $themes;
/**
* Filter the locales requested for theme translations.
*
* @since 3.7.0
*
* @param array $locales Defaults to the current locale of the site.
*/
$locales = apply_filters( 'themes_update_check_locales', array( get_locale() ) );
$options = array(
'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
'body' => array(
'themes' => json_encode( $request ),
'translations' => json_encode( $translations ),
'locale' => json_encode( array( get_locale() ) ), // @todo filter.
'locale' => json_encode( $locales ),
),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);