Question about hooks - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8) +--- Thread: Question about hooks (/showthread.php?tid=5321) |
Question about hooks - Kolyok - 2013-10-29 Hello guys. I've been messing with filters and hooks inside a template's functions.php and i couldn't find a way to get a working backend hook. The reason why i wanted this is that i use a lot of plugins (smaller ones) and i thought of moving some of their functionality directly to the template itself so i don't have too many plugins in the backend (just to keep things clean and this way i dont have to worry about plugins dependencies) so i have some functions to cache navigation, submenus, rss, etc and i need to clear some cache on changedata-save. Now the question is: Can I somehow access backend-hooks from the functions.php or i must create a separate plugin for these? RE: Question about hooks - shawn_a - 2013-10-29 Hooks outside of plugins is not supported. RE: Question about hooks - Kolyok - 2013-10-30 Edit: Frontend hooks works in functions.php of the theme. (Not sure if you meant that none of the hooks are supported outside plugins or just backend hooks) Edit 2: Nevermind the above >< im always mixing up hooks and filters... Okay thanks for the fast answer. So ill just move all the backend stuff into one plugin. I have another question: Is it fine to pack a theme with its plugin and make an auto installer for it? For example the install/update process (well when activating) of the theme itself will check if the plugin exists/its the latest version. If so then just remove the plugin from the theme pack else install/update (move it to the plugins folder) the plugin and auto activate it. Also note that the plugin itself never gets updated only if theme is updated too so the above process would make it easier to maintain. What do you think? |