Webmastersite.net

Search    Register    Log In   

Details

changeswitches and changesettings tweaks
By
Apr 19, 2017 pm30 10:39 PM (Edited )

Adding a couple of new tweaks today: changeswitches and changesettings. These allow you to change the value of any switch or setting using your tweaks.php file, instead of using the admin panel. My personal use case is for my development site where I want to do my testing with reCAPTCHA and alertify turned off, but not actually configure the site that way because my release tools make the development copy's configuration be the default configuration. I'd imagine you might want to use it to create special tweaks files you can upload to a site to put it into a testing configuration, or something like that.

Here's how it works. Open tweaks.php in a text editor. Then add lines like this before the ?>:

$changesettings['stopspam'] = 'bait';
$changeswitches['alertify'] = 0;

Note that switches must always be 0 (turned off) or 1 (turned on). You can add as many settings or switches as you like.

In order to avoid accidentally saving the changed state in the admin, these changes are applied only on front-end pages -- not in the admin panel.




Views 557 views. Averaging 557 views per day.

Sorry, you don't have permission to post. Log in, or register if you haven't yet.

Please login or register.