Don't request empty locales list for plugin translations.

This commit is contained in:
budzanowski 2020-07-28 11:37:51 +02:00
parent 05d5ff0417
commit ac501dea64
1 changed files with 5 additions and 0 deletions

View File

@ -191,6 +191,11 @@ class WC_Helper_Updater {
$locales = apply_filters( 'plugins_update_check_locales', $locales );
$locales = array_unique( $locales );
// No locales, means that the respone will be empty.
if ( empty( $locales ) ) {
return array();
}
// Scan local plugins which may or may not have a subscription.
$plugins = WC_Helper::get_local_woo_plugins();
$active_woo_plugins = array_intersect( array_keys( $plugins ), get_option( 'active_plugins', array() ) );