I am using wordpress REST api to provide certain data from website to app server. This custom route is used to send default image and everything works fine. Now I want to use set_transient, I used following code to do so.
$transient='apidata_json_cache';
$expiration =2*60; // 2 Minutes
if(false === ($feed=get_transient($transient))) {
echo '<!--Fresh data-->';
/*data extraction process here, which is than stored in $feed*/
set_transient($transient,$feed,$expiration);
}
Now each time run the code. The transient is stored with name "_transient__default_thumbnail", _default_thumbnail is the name of one of the ACF field used during extraction of data.
$images['_default_thumbnail'] = get_field('_default_thumbnail','options');
I dont want to save transient with that name. Can you please help to find out what is wrong or what am I missing while creating transient.
Thank you