![]() |
|
theme's functions.php exectuded during setup - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Themes (https://forum.zenphoto.org/forum-5.html) +--- Thread: theme's functions.php exectuded during setup (/thread-13037.html) |
theme's functions.php exectuded during setup - vincent3569 - 30-11-2017 hi, it seems that my theme's functions.php file is executed during setup process. and in fact, I can see 'Theme setup:' during setup process and I was thinking only themeoptions.php was running during this process . can you explain what is running during setup process, especcilally about themes (selected or notin admin) ? is it depending of OFFSET_PATH value used in my functions.php file? which value of OFFSET_PATH should I use in functions.php to use it only when my theme is used in front end ? theme's functions.php exectuded during setup - vincent3569 - 30-11-2017 to give an example: I have this lines in my functions.php :
colorbox and slideshow plugin are disabled during setup process. theme's functions.php exectuded during setup - acrylian - 30-11-2017 Simple answer: Themes and their functions are technically also kind of plugins. They are run/loaded on Setup (2nd page) to see if they are valid.
A theme's IMHO a theme should or could enable plugins it needs but it should not disable them itself. You might have a customized theme version that wants them. That should be left to the user. theme's functions.php exectuded during setup - vincent3569 - 30-11-2017 thanks for the answer. theme's functions.php exectuded during setup - acrylian - 30-11-2017 No, but I don't really understand what the issue is with this. It's just on setup. All that happens is that the options are already set. Once you enable a different theme it can override these again. Actual plugins are loaded after the theme functions.php. theme's functions.php exectuded during setup - vincent3569 - 30-11-2017 I wish to disable some unsupported plugins (in my theme) to avoid loading of unnecessary scripts (CSS and JS). but I understand that is the responsability of admin to right configure its own website... theme's functions.php exectuded during setup - acrylian - 30-11-2017 I do understand what you want to do. But your theme can do it like you do. It is really not a problem if things are loaded while setup runs. This is outside of the actual frontend anyway.
theme's functions.php exectuded during setup - sbillard - 30-11-2017 The proper way to disable things you don't want loaded in a theme is to do so "temporarily." That is reset the persistent parameter. You can do this in your functions.php script and the plugin will not load. Permanently disabling things in a Theme would be considered not playing nicely, in my opinion. You really should let the site admin decide if he wants a feature or not. But if your theme must disable something because of its design, do it so the change is not persistent. theme's functions.php exectuded during setup - vincent3569 - 01-12-2017 I have tests with temporarily disable plugins in And as far I can test, I can't use
So I have non choice: I will do some cleanup in my theme's functions.php exectuded during setup - acrylian - 01-12-2017 I really have to agree that it is the job of the site admin to only enable what he needs to. You really can't do everything for him… theme's functions.php exectuded during setup - vincent3569 - 04-12-2017 OK you are right, I will suppress this code but, according to me, zenphoto should separate 2 things :
in other words, functions.php should only called "by the front-end", and not by "the back-end". I would be more clear and simple like that. theme's functions.php exectuded during setup - acrylian - 04-12-2017 Sorry, you are really seeing an issue where there is none. Again, setup loads the functions.php of any theme to validate as it does with eveyr plugin. Setup is not the backend. A theme's functions.php is not direclty used on the backend but since it is kind of a plugin it may very well containt filter calls or functions that are used within the theme options. Sorry, i will be closing this topic. |