We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ec99550 + 37821fc commit e6873cdCopy full SHA for e6873cd
src/Loader.php
@@ -75,6 +75,28 @@ public static function init() {
75
}
76
77
78
+ /**
79
+ * Get cache token used in API requests.
80
+ *
81
+ * @return string Cache token.
82
+ */
83
+ public static function get_cache_token() {
84
+ $cache_token = get_transient( 'themeisle_sdk_cache_token' );
85
+ if ( false === $cache_token ) {
86
+ $cache_token = wp_generate_password( 6, false );
87
+ set_transient( $cache_token, WEEK_IN_SECONDS );
88
+ }
89
+
90
+ return $cache_token;
91
92
93
94
+ * Clear cache token.
95
96
+ public static function clear_cache_token() {
97
+ delete_transient( 'themeisle_sdk_cache_token' );
98
99
100
/**
101
* Register product into SDK.
102
*
0 commit comments