General developer forum

making the filter "On" by default on installation

 
Picture of Patrick Scott
making the filter "On" by default on installation
 

hi

i'm developing a filter.


I see that when installing a new filter, it is only installed in as "Disabled" under /admin/filters.php.
is there a way to make a certain filter in the "On" state on installation?
instead of doing it at  /admin/filters.php after installation

I want to do so in my new developed filter.

i'm using moodle 3.1

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: making the filter "On" by default on installation
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

In your filter, add a file db/install.php (https://docs.moodle.org/dev/Plugin_files#db.2Finstall.php) the function in there gets run when your plugin is installed, and using that you can turn your filter on.

 
Average of ratings: -