MyBB Community Forums

Full Version: [HELP] Devlopment of plugin to integrate android api calls
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
am new to php. I am trying to develop api calls for mybb. But I really had a hard time finding the source of the hooks. For external plugin hooks it is in the /inc/plugins folder, But I can't find the hooks that are default in mybb. I am tracing "member_do_register_start".
I am trying to devlop the api's to make android app for mybb forums. I will make it open source in success.
Hi,

There is a list of available hooks, found here: https://docs.mybb.com/1.8/development/plugins/hooks/

The list shows which file the hooks are defined in, and on which line they are defined. It also notes any possible parameters passed to the functions attached to the hooks.
(2017-02-21, 08:26 PM)Euan T Wrote: [ -> ]Hi,

There is a list of available hooks, found here: https://docs.mybb.com/1.8/development/plugins/hooks/

The list shows which file the hooks are defined in, and on which line they are defined. It also notes any possible parameters passed to the functions attached to the hooks.

Thanks Euan for replying. But everywhere all I got is 1 occurance in the member.php file on line 90($plugins->run_hooks("member_do_register_start")).
But what I am finding is the file which have the line---$plugins->add_hooks("member_do_register_start", "function name") 
Basically the file which created the hook. I hope I am clear.
Hi,

I wonder if maybe the issue is you're misunderstanding how hooks work.

Hooks are declared using:

$plugins->run_hooks('xyz');

This declares that a function can "hook" into this given location and access variables within scope, and output data.

Somewhere else (such as in a plugin), you attach a function to a hook that has been declared, using:

$plugins->add_hook('xyz', 'some_function');

function some_function()
{
    // Any code here will execute when `$plugins->run_hooks('xyz');` is called
}

Hopefully that helps?