Save options callback. Clear simpleCache

Espen Espelund

Active member
I got a plugin that saves a query to simpleCache with cron every 5 min.
When I update the addon options, I obviously want to clear the cache. Are there some way to set up a callback / listener when saving an options group?
 
Figured it out.

PHP:
<?php
class Fitnessbloggen_HotThreads_ControllerAdmin_Option extends XFCP_Fitnessbloggen_HotThreads_ControllerAdmin_Option
{
    public function actionSave()
    {
        $this->_assertPostOnly();
 
        $input = $this->_input->filter(array('group_id' => XenForo_Input::STRING));
       
        if ($input['group_id'] == "hotthreads") {
            XenForo_Application::setSimpleCacheData('hotThreads', false);
        }
 
        return parent::actionSave();
    }
}
 
Back
Top Bottom