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' => ...,


{} Это метод класса: WC_Admin_Addons{}

Хуков нет.


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


$result = WC_Admin_Addons::set_locale_data_in_transient( $transient, $value, $locale, $expiration );
$transient(строка) (обязательный)
Transient name. Expected to not be SQL-escaped. Must be 172 characters or fewer in length.
$value(разное) (обязательный)
Transient value. Must be serializable if non-scalar. Expected to not be SQL-escaped.
$locale(строка) (обязательный)
Locale to set.
Time until expiration in seconds.
По умолчанию: 0 (no expiration)

Код WC_Admin_Addons::set_locale_data_in_transient() WC 6.9.4

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