WC_Admin_Addons::get_locale_data_from_transient()
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.
Return
Mixed
. Value of transient.
Usage
$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() WC Admin Addons::get locale data from transient code WC 9.7.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; }