Make WordPress Core

Changeset 25634


Ignore:
Timestamp:
09/28/2013 04:17:54 AM (11 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

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

    r25566 r25634  
    204204    $to_send = compact( 'plugins', 'active' );
    205205
     206    /**
     207     * Filter the locales requested for plugin translations.
     208     *
     209     * @since 3.7.0
     210     *
     211     * @param array $locales Defaults to the current locale of the site.
     212     */
     213    $locales = apply_filters( 'plugins_update_check_locales', array( get_locale() ) );
     214
    206215    $options = array(
    207216        'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
     
    209218            'plugins'      => json_encode( $to_send ),
    210219            'translations' => json_encode( $translations ),
    211             'locale'       => json_encode( array( get_locale() ) ), // @todo filter.
     220            'locale'       => json_encode( $locales ),
    212221        ),
    213222        'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
     
    330339    $request['themes'] = $themes;
    331340
     341    /**
     342     * Filter the locales requested for theme translations.
     343     *
     344     * @since 3.7.0
     345     *
     346     * @param array $locales Defaults to the current locale of the site.
     347     */
     348    $locales = apply_filters( 'themes_update_check_locales', array( get_locale() ) );
     349
    332350    $options = array(
    333351        'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
     
    335353            'themes'       => json_encode( $request ),
    336354            'translations' => json_encode( $translations ),
    337             'locale'       => json_encode( array( get_locale() ) ), // @todo filter.
     355            'locale'       => json_encode( $locales ),
    338356        ),
    339357        'user-agent'    => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
Note: See TracChangeset for help on using the changeset viewer.