Advertisement
Guest User

Untitled

a guest
May 29th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. /**
  2. * myCRED Hook Skeleton
  3. * @version 1.2
  4. */
  5. class my_custom_hook_class extends myCRED_Hook {
  6.  
  7. /**
  8. * Construct
  9. * Used to set the hook id and default settings.
  10. */
  11. function __construct( $hook_prefs, $type ) {
  12.  
  13. parent::__construct( array(
  14. 'id' => 'unique_hook_id',
  15. 'defaults' => array(
  16. 'creds' => 1,
  17. 'log' => 'points for something'
  18. )
  19. ), $hook_prefs, $type );
  20.  
  21. }
  22.  
  23. /**
  24. * Run
  25. * Fires by myCRED when the hook is loaded.
  26. * Used to hook into any instance needed for this hook
  27. * to work.
  28. */
  29. public function run() {
  30.  
  31. }
  32.  
  33. /**
  34. * Hook Settings
  35. * Needs to be set if the hook has settings.
  36. */
  37. public function preferences() {
  38.  
  39. // Our settings are available under $this->prefs
  40. $prefs = $this->prefs;
  41.  
  42. }
  43.  
  44. /**
  45. * Sanitize Preferences
  46. * If the hook has settings, this method must be used
  47. * to sanitize / parsing of settings.
  48. */
  49. public function sanitise_preferences( $data ) {
  50.  
  51. return $data;
  52.  
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement