On this page
wp_get_translation_updates(): object[]
Retrieves a list of all language updates available.
Return
object[] Array of translation objects that have available updates.
Source
File: wp-includes/update.php. View all references
function wp_get_translation_updates() {
$updates = array();
$transients = array(
'update_core' => 'core',
'update_plugins' => 'plugin',
'update_themes' => 'theme',
);
foreach ( $transients as $transient => $type ) {
$transient = get_site_transient( $transient );
if ( empty( $transient->translations ) ) {
continue;
}
foreach ( $transient->translations as $translation ) {
$updates[] = (object) $translation;
}
}
return $updates;
}
Related
Uses
| Uses | Description |
|---|---|
| get_site_transient() wp-includes/option.php | Retrieves the value of a site transient. |
Used By
| Used By | Description |
|---|---|
| WP_Automatic_Updater::run() wp-admin/includes/class-wp-automatic-updater.php | Kicks off the background update process, looping through all pending updates. |
| Language_Pack_Upgrader::async_upgrade() wp-admin/includes/class-language-pack-upgrader.php | Asynchronously upgrades language packs after other upgrades have been made. |
| Language_Pack_Upgrader::bulk_upgrade() wp-admin/includes/class-language-pack-upgrader.php | Bulk upgrade language packs. |
| list_translation_updates() wp-admin/update-core.php | Display the update translations form. |
| wp_get_update_data() wp-includes/update.php | Collects counts and UI strings for available updates. |
Changelog
| Version | Description |
|---|---|
| 3.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_get_translation_updates