![]() |
|
is it possible to force a plugin - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: is it possible to force a plugin (/thread-9341.html) |
is it possible to force a plugin - vincent3569 - 2011-12-03 hi is it possible to force a plugin in a specific theme ? for exemple :
is it possible to force a plugin - acrylian - 2011-12-03 Yes, basically by setting the options to enable it. is it possible to force a plugin - vincent3569 - 2011-12-03 ok my question was incorrect : is it possible to force a plugin in a specific theme by the theme itself (in themeoptions.php for exemple) ? it seems to be possible by using setOption() and setOptionDefault, that's true ? can you explain what are the differences between this 2 functions ? is it possible to force a plugin - acrylian - 2011-12-03 That is what I was referring to. The difference between setOption and setOptionDefault is that the 2nd sets the default(!) values on first creation. You can use setOption even to change options temporarily with the right parameter (does not work for all options though). is it possible to force a plugin - sbillard - 2011-12-03 More to the point. is it possible to force a plugin - vincent3569 - 2011-12-03 thanks guys for the clear answer ! for me, a problem is setOptionDefault has no effect if the option have already a value (set by another theme, or set by the user for example) for my personnal needs, I wrote this line in my theme : fyi, in zenpage/themeoptions.php, I have found this is it possible to force a plugin - sbillard - 2011-12-03 As said, if the option already has a value, If the plugin has a statement like The other approach you can take is to have your plugin do a [edit] Of course, The line is zenpage does in fact work, although it is not in general the correct code. It works because the colorbox plugin is a "theme plugin" as we have implemented it. the value Just fyi, |