Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about hooks
#1
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?
Reply
#2
Hooks outside of plugins is not supported.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
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?
Reply




Users browsing this thread: 1 Guest(s)