This is an old revision of the document!


Technical changes in Piwigo 2.7

add_event_handler() 4th parameter

The fourth parameter of *add_event_handler* function was used to tell the number of parameters which will be transmitted to the callback. This is no longer used: all parameters given to *trigger_change* or *trigger_notify* are always transmitted to all callback.

But the fourth parameter is still used: if a string is given it will be used as a file path included just before the callback (with *include_once*).

// procedural
add_event_handler('init', 'my_init',
  EVENT_HANDLER_PRIORITY_NEUTRAL,
  MY_PLUGIN_PATH . 'include/callbacks.php'
  );
 
// OOP with static method
add_event_handler('init', array('MyClass', 'init'),
  EVENT_HANDLER_PRIORITY_NEUTRAL,
  MY_PLUGIN_PATH . 'include/myclass.php'
  );

If the 4th parameter is anything else than a string it is ignored.

 
Back to top
dev/changes_in_2.7.1392735910.txt.gz · Last modified: 2014/02/18 16:05 by mistic100
 
 
github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact