/** * ugprades languages files after a core upgrade * only for backward compatibility WP < 4.0 *AND* Polylang < 1.6 * * @since 0.6 * * @param string $version new WP version */ public function upgrade_languages($version) { // $GLOBALS['wp_version'] is the old WP version if (version_compare($version, '4.0', '>=') && version_compare($GLOBALS['wp_version'], '4.0', '<')) { /** This filter is documented in wp-admin/includes/update-core.php */ apply_filters('update_feedback', __('Upgrading language files…', 'polylang')); PLL_Upgrade::download_language_packs(); } }
public function upgrade_languages($version) { // $GLOBALS['wp_version'] is the old WP version if (version_compare($version, '4.0', '>=') && version_compare($GLOBALS['wp_version'], '4.0', '<')) { apply_filters('update_feedback', __('Upgrading language files…', 'polylang')); PLL_Upgrade::download_language_packs(); } }
public function upgrade_languages($version) { // backward compatibility WP < 4.0 if (version_compare($version, '4.0', '<')) { apply_filters('update_feedback', __('Upgrading language files…', 'polylang')); foreach ($this->model->get_languages_list() as $language) { if (!empty($_POST['locale']) && $language->locale != $_POST['locale']) { // do not (re)update the language files of a localized WordPress PLL_Admin::download_mo($language->locale, $version); } } } elseif (version_compare($GLOBALS['wp_version'], '4.0', '<')) { apply_filters('update_feedback', __('Upgrading language files…', 'polylang')); PLL_Upgrade::download_language_packs(); } }