WordPress开发者和主题制作者的搜索引擎



wp_get_translation_updates ›

Since3.7.0
已弃用n/a
wp_get_translation_updates ( 没有参数 )
返回:
  • (object[]) Array of translation objects that have available updates.
定义在:
文档:

Retrieves a list of all language updates available.



源码

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