Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * myCRED Hook Skeleton
- * @version 1.2
- */
- class my_custom_hook_class extends myCRED_Hook {
- /**
- * Construct
- * Used to set the hook id and default settings.
- */
- function __construct( $hook_prefs, $type ) {
- parent::__construct( array(
- 'id' => 'unique_hook_id',
- 'defaults' => array(
- 'creds' => 1,
- 'log' => 'points for something'
- )
- ), $hook_prefs, $type );
- }
- /**
- * Run
- * Fires by myCRED when the hook is loaded.
- * Used to hook into any instance needed for this hook
- * to work.
- */
- public function run() {
- }
- /**
- * Hook Settings
- * Needs to be set if the hook has settings.
- */
- public function preferences() {
- // Our settings are available under $this->prefs
- $prefs = $this->prefs;
- }
- /**
- * Sanitize Preferences
- * If the hook has settings, this method must be used
- * to sanitize / parsing of settings.
- */
- public function sanitise_preferences( $data ) {
- return $data;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement