A WordPress-centric search engine for devs and theme authors



wp_get_translation_updates ›

Since3.7.0
Deprecatedn/a
wp_get_translation_updates ( No parameters )
Returns:
  • (object[]) Array of translation objects that have available updates.
Defined at:
Codex:

Retrieves a list of all language updates available.



Source

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