Data from class hook
#1
Hey,

is it possible to get data from a class hook like:
$plugins->run_hooks('datahandler_user_delete_start', $this);

If yes -> HOW?! - I'm looking for the delete_uids from this hook Smile
Reply
#2
When you use the hook, the callback will accept a parameter, where you'd be able to access that property:

function my_plugin_datahandler_user_delete_start($datahandler)
{
	// can access $datahandler->delete_uids
}
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply
#3
$plugins->add_hook("datahandler_user_delete_start", "dhudels");
function dhudels($obj)
{
var_dump($obj);
}

Web,Windows,Android Programmer
Wordpress,Mybb,... Developer

Reply
#4
Thank you both for replying

I've tried to manage it like this:
$plugins->add_hook('datahandler_user_delete_start', 'myfunction_user');
function myfunction_user($data)
{
    foreach ($data->delete_uids as $key => $uid)
    {
        /**    */
    }
}

The hook has to be defined in AdminCP or not?

Oh lord..I was a little bit tired yesterday.

Finally I figured it out...the needed hook was on wrong position.

Thank you all for suggestions!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)