From 0ca258d161ef3253e2188ddbec831645329a01e0 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Mon, 2 May 2022 18:26:21 +0200 Subject: [PATCH] feat(transient): migrate to option --- src/i18n-v3.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/i18n-v3.php b/src/i18n-v3.php index 59afffb..606e53b 100644 --- a/src/i18n-v3.php +++ b/src/i18n-v3.php @@ -180,11 +180,11 @@ private function init( $args ) { * @return bool */ private function hide_promo() { - $hide_promo = get_transient( 'yoast_i18n_' . $this->project_slug . '_promo_hide' ); + $hide_promo = get_option( 'yoast_i18n_' . $this->project_slug . '_promo_hide' ); if ( ! $hide_promo ) { if ( filter_input( INPUT_GET, 'remove_i18n_promo', FILTER_VALIDATE_INT ) === 1 ) { // No expiration time, so this would normally not expire, but it wouldn't be copied to other sites etc. - set_transient( 'yoast_i18n_' . $this->project_slug . '_promo_hide', true ); + update_option( 'yoast_i18n_' . $this->project_slug . '_promo_hide', true ); $hide_promo = true; } } @@ -289,16 +289,16 @@ public function promo() { } /** - * Try to find the transient for the translation set or retrieve them. + * Try to find the option for the translation set or retrieve them. * * @return object|null */ private function find_or_initialize_translation_details() { - $set = get_transient( 'yoast_i18n_' . $this->project_slug . '_' . $this->locale ); + $set = get_option( 'yoast_i18n_' . $this->project_slug . '_' . $this->locale ); if ( ! $set ) { $set = $this->retrieve_translation_details(); - set_transient( 'yoast_i18n_' . $this->project_slug . '_' . $this->locale, $set, DAY_IN_SECONDS ); + update_option( 'yoast_i18n_' . $this->project_slug . '_' . $this->locale, $set ); } return $set;