hi
I have to enable a plugin from my theme (tags_extrats).
I know how disable a plugin but I am not sure to enable it.
How manage $priority, especially for this plugin ?
`
function enableExtension($extension, $priority, $persistent = true) {
setOption('zp_plugin_' . $extension, $priority, $persistent);
}
`
Comments
If your theme has dependencies on plugins, add checks for it. I have a feeling with your goolgemaps topic that you are overcomplicating things a bit currently.
But maybe you don't have to enable it. You can always just `require` the plugin script in your theme head. That may not work with all plugins, though. Which plugins are you interested to do this with?
I try to create a custom album page with isotope layout.
it enables filter of pictures based on the tags of the pictures of the album (a working example here: http://test.vincentbourganel.fr/fetes-des-lumieres-de-lyon/ )
so I need to use tag_extras plugin to access on albums tags.
the way I found to do that is to enable plugin in function.php.
of course, if you have a best way to do that, I will apply your suggestion or code with pleasure.
thanks in advance for your help.
Again, Zenphoto leaves you the freedom to do things different way. I would do it that way. A user using Zenphoto should naturally know about plugins and how to enable them. Especially since that is not complicated if support is built into a theme already.
You should avoid such hard requirements of plugins because what if the plugin is not included anymore in the future? Then people even need to install it first (no plan to remove it though).
- I can ask users to allow the plugin
- theme can allow itself the plugin without asking to users
- theme can use the plugin functions without enable it, by using require_once.
finaly, that is the 3rd way I use for my need.