wp_get_translation_updates()WP 3.7.0

Retrieves a list of all language updates available.

No Hooks.

Return

Object[]. Array of translation objects that have available updates.

Usage

wp_get_translation_updates();

Changelog

Since 3.7.0 Introduced.

wp_get_translation_updates() code WP 6.5.2

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;
}