WC_Admin_Addons::get_locale_data_from_transient()private staticWC 1.0

Retrieves the locale data from a transient.

Transient value is an array of locale data in the following format: array(

'en_US' => ...,
'fr_FR' => ...,


If the transient does not exist, does not have a value, or has expired, then the return value will be false.

Method of the class: WC_Admin_Addons{}

No Hooks.


Mixed. Value of transient.


$result = WC_Admin_Addons::get_locale_data_from_transient( $transient, $locale );
$transient(string) (required)
Transient name. Expected to not be SQL-escaped.
$locale(string) (required)
Locale to retrieve.

WC_Admin_Addons::get_locale_data_from_transient() code WC 7.5.1

private static function get_locale_data_from_transient( $transient, $locale ) {
	$transient_value = get_transient( $transient );
	$transient_value = is_array( $transient_value ) ? $transient_value : array();
	return $transient_value[ $locale ] ?? false;