Hello good people, I am creating a plugin for my site, I would like to use hooks within class construct object. But I dont Know how to make it happen. here is a code am working with, your help will be appreciated. Thank you<?php
/**
* The file that defines the core plugin class
*
* A class definition that includes attributes and functions used across both the
* public-facing side of the site and the admin area.
*
* @link http://pixadrop.com
* @since 1.0.0
*
* @package easy_avatar
* @subpackage easy_avatar/includes
*/
/**
* The core plugin class.
*
* This is used to define internationalization, admin-specific hooks, and
* public-facing site hooks.
*
* Also maintains the unique identifier of this plugin as well as the current
* version of the plugin.
*
* @since 1.0.0
* @package easy_avatar
* @subpackage easy_avatar/includes
* @author Your Name <email@example.com>
*/
class easy_avatar_delete_user {
/**
* The instance that's responsible for creating an instance of self
* the plugin.
*
* @since 1.0.0
* @access protected
* @var $instance store all instance.
*/
private static $instance;
/**
* Define the core functionality of the plugin.
*
* Set the plugin name and the plugin version that can be used throughout the plugin.
* Load the dependencies, define the locale, and set the hooks for the admin area and
* the public-facing side of the site.
*
* @since 1.0.0
*/
public function __construct() {
osc_add_hook('delete_user', array($this, 'esa_delete_dir' ));
osc_add_hook('delete_user', array($this, 'esa_drop_row'));
}
/**
* Singleton constructor.
* @return an theme_images object.
*/
public static function newInstance() {
if(!self::$instance instanceof self) {
self::$instance = new self;
}
return self::$instance;
}
/**
* Delete user avatart directory when use is removed
* of the plugin.
*
* @since 1.0.0
* @access private
*/
public function esa_delete_dir($id){
}
/**
* Drop user table row when user is removed
* of the plugin.
*
* @since 1.0.0
* @access private
*/
public function esa_drop_row($id){
}
}