WC_Admin_Addons::set_locale_data_in_transient()private staticWC 1.0

Sets the locale data in a transient.

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

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

)

Method of the class: WC_Admin_Addons{}

No Hooks.

Return

true|false. True if the value was set, false otherwise.

Usage

$result = WC_Admin_Addons::set_locale_data_in_transient( $transient, $value, $locale, $expiration );
$transient(string) (required)
Transient name. Expected to not be SQL-escaped. Must be 172 characters or fewer in length.
$value(mixed) (required)
Transient value. Must be serializable if non-scalar. Expected to not be SQL-escaped.
$locale(string) (required)
Locale to set.
$expiration(int)
Time until expiration in seconds.
Default: 0 (no expiration)

WC_Admin_Addons::set_locale_data_in_transient() code WC 8.7.0

private static function set_locale_data_in_transient( $transient, $value, $locale, $expiration = 0 ) {
	$transient_value            = get_transient( $transient );
	$transient_value            = is_array( $transient_value ) ? $transient_value : array();
	$transient_value[ $locale ] = $value;
	return set_transient( $transient, $transient_value, $expiration );
}