Posts: 679
Threads: 80
Joined: Nov 2009
Would it be possible to add hooks to a plugin for say?
Example:
I created a recent activity plugin, I would like it to display all recent activity. Would it be possible for me to add this code and allow others to insert recent activities into my list?
Code:
<ul>
<li>example activity</li>
<?php exec_action(simple-recentactivity); ?>
</ul>
does this make sense?
Posts: 972
Threads: 27
Joined: Aug 2009
Did you test it? Because I think it will work exactly like that, well, if you but quotes around “simple-recentactivityâ€Â. As far as I know none of the hook names are hard coded so you can register function to any hook name and you can call an exec_action() on any name as well.
Posts: 679
Threads: 80
Joined: Nov 2009
I havent tried this. Do you know if there is a hook within any of the menus? I would like to create a plugin for external links, but I can't insert the list into your plugin (unless you add a hook) and I can't insert it in the main menu, unless there is a hidden hook somewhere? (I have looked pretty good over all the code.)
Posts: 972
Threads: 27
Joined: Aug 2009
No, there are no hooks in the menu. You saw right.
Neither are there in my menu plugin, though it might be something I should think about. Hmm…
Posts: 679
Threads: 80
Joined: Nov 2009
There really should be a hook within the menu. (preferably within the <ul>tags</ul> that way we could insert <li>
with different things.
If chris is reading this, you should add one right after the first <ul> and then right before the last </ul>
I think it would be interesting to see what people would do if they new they could use hooks within there plugin.
Posts: 972
Threads: 27
Joined: Aug 2009
The <ul> and </ul> are actually in your template, so hooks don’t make much of a difference there. I agree, it will be interesting to see people putting hooks in their plugins!
Posts: 679
Threads: 80
Joined: Nov 2009
Lol, I just pulled the <ul> <li> crap out of my but.
You should see what you can do as far as creating hooks in your new menu plugin.
Posts: 1,848
Threads: 86
Joined: Aug 2009
i think that should work OWS_Matthew - i see no reason why it wouldnt
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!