Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plugin hook within a plugin.
#1
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?
JWH Technologies
Have any marketing ideas for Get-Simple? Let me hear them!
Reply
#2
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.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
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.)
JWH Technologies
Have any marketing ideas for Get-Simple? Let me hear them!
Reply
#4
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…
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#5
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.
JWH Technologies
Have any marketing ideas for Get-Simple? Let me hear them!
Reply
#6
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!
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#7
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.
JWH Technologies
Have any marketing ideas for Get-Simple? Let me hear them!
Reply
#8
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!
Reply




Users browsing this thread: 1 Guest(s)