Make WordPress Core

Changeset 36630


Ignore:
Timestamp:
02/23/2016 04:16:29 PM (9 years ago)
Author:
ocean90
Message:

Updates: Pass locales of all available languages to the themes/plugins update API.

This ensures that language packs for all languages in a Multisite install are updated.

Fixes #34937.

File:
1 edited

Legend:

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

    r36182 r36630  
    263263    $to_send = compact( 'plugins', 'active' );
    264264
     265    $locales = array_values( get_available_languages() );
    265266    /**
    266267     * Filter the locales requested for plugin translations.
    267268     *
    268269     * @since 3.7.0
    269      *
    270      * @param array $locales Plugin locale. Default is current locale of the site.
     270     * @since 4.5.0 Changed default value of `$locales` to include all locales.
     271     *
     272     * @param array $locales Plugin locales. Default is all available locales of the site.
    271273     */
    272     $locales = apply_filters( 'plugins_update_check_locales', array( get_locale() ) );
     274    $locales = apply_filters( 'plugins_update_check_locales', $locales );
     275    $locales = array_unique( $locales );
    273276
    274277    if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
     
    433436    $request['themes'] = $themes;
    434437
     438    $locales = array_values( get_available_languages() );
    435439    /**
    436440     * Filter the locales requested for theme translations.
    437441     *
    438442     * @since 3.7.0
    439      *
    440      * @param array $locales Theme locale. Default is current locale of the site.
     443     * @since 4.5.0 Changed default value of `$locales` to include all locales.
     444     *
     445     * @param array $locales Theme locales. Default is all available locales of the site.
    441446     */
    442     $locales = apply_filters( 'themes_update_check_locales', array( get_locale() ) );
     447    $locales = apply_filters( 'themes_update_check_locales', $locales );
     448    $locales = array_unique( $locales );
    443449
    444450    if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
Note: See TracChangeset for help on using the changeset viewer.