I keep reading it, but I dont Understand - Hooks
#1
Question 
What exactly happens when you run a plugin hook? I keep reading, but I just don't seem to get it…………

I know when you add a hook, then that added function will run when that hook runs, but another thing that confuses me is the difference between hooks such as warning_start and do_warnings_start
Do NOT pm me for support on ANY of my plugins
DO pm me if you got suggestions for existing ones (although posting in the proper thread is preferred), or suggestions/ideas for new plugins (keep in mind I'm an amateur but not necessarily a beginner.)
Reply
#2
(02-11-2015, 10:12 PM)Ircher Wrote: but another thing that confuses me is the difference between hooks such as warning_start and do_warnings_start

They are simply used in other places if you open core files - you should just open warnings.php to see where they are and why.
https://github.com/mybb/mybb/blob/featur...gs.php#L39
https://github.com/mybb/mybb/blob/featur...gs.php#L71
Reply
#3
Like destroy said, you need to look at the actual core files to see why a particular hook is run.

But basically when you call a hook, you run a function at that point in the code where the hook runs the plugins. You add functions to be called at certain points in core files to manipulate the core functionality of MyBB.
My Plugins: [1.8]|[1.6]

** Selling custom plugin that enables Bitcoin payments. PM me if interested in purchasing! **
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)