Changeset 48641
- Timestamp:
- 07/27/2020 06:29:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php
r48627 r48641 286 286 'slug' => $slug, 287 287 'fields' => array( 288 'sections' => false, 288 'sections' => false, 289 'language_packs' => true, 289 290 ), 290 291 ) … … 354 355 return $changed_status; 355 356 } 357 } 358 359 // Install translations. 360 $installed_locales = array_values( get_available_languages() ); 361 /** This filter is documented in wp-includes/update.php */ 362 $installed_locales = apply_filters( 'plugins_update_check_locales', $installed_locales ); 363 364 $language_packs = array_map( 365 function( $item ) { 366 return (object) $item; 367 }, 368 $api->language_packs 369 ); 370 371 $language_packs = array_filter( 372 $language_packs, 373 function( $pack ) use ( $installed_locales ) { 374 return in_array( $pack->language, $installed_locales, true ); 375 } 376 ); 377 378 if ( $language_packs ) { 379 $lp_upgrader = new Language_Pack_Upgrader( $skin ); 380 381 // Install all applicable language packs for the plugin. 382 $lp_upgrader->bulk_upgrade( $language_packs ); 356 383 } 357 384
Note: See TracChangeset
for help on using the changeset viewer.