How to programatically clear theme cache?

How to programatically clear theme cache?

by wz z -
Number of replies: 3

I know how to do this manually: Settings > Site administration > Themes > Theme selector. Click the “Clear theme caches” button.

But I don't know how to do it programatically or even make it directly manipulate the database.

Average of ratings: -
In reply to wz z

Re: How to programatically clear theme cache?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Please kindly read the forum rules as any answer may depend on the version of Moodle you are using.

Why do you want to do this?  When do you want to do this?  Do you want to do this from a theme or something else?  If in a theme, do you want this to happen when a setting changes or something else?

In reply to Gareth J Barnard

Re: How to programatically clear theme cache?

by wz z -

Thank you for your notice. I want to clean the theme cache in a cron task. My Moodle version is 3.4.