Overview
Filters allow the admin to modify or hook into specific aspects of a task. Webuzo offers numerous filters for you to utilize.
This guide will demonstrate how the Server Admin can set up Filter Functions to customize the installation, upgrade, email, and other events.
First, SSH into your server and navigate to: /usr/local/webuzo/
Create hooks folder if it is not present. Create filter.php file inside hooks folder.
The final path will be : /usr/local/webuzo/hooks/filter.php
Copy paste the following filters as per your requirements inside the filter.php file.
The pre_add_domain filter will trigger your function right before a Domain is added.
To call filer for different type of domain you have to pass type of domain name
For parked domains $domain_data['type'] == 'parked', pass 'addon' for Addon domain and 'subdomain' for Subdomains
//FILTER to call specific function
add_filter('pre_add_domain', 'my_pre_add_domain', 10, 4);
function my_pre_add_domain($user, $domain, $document_root, $domain_data){
if($domain_data['type'] == 'domain_type'){
//code
//Write your code here
}
}post_add_domain
The post_add_domain filter will trigger your function after a Domain is added
To call filer for different type of domain you have to pass type of domain name
For parked domains $domain_data['type'] == 'parked', pass 'addon' for Addon domain and 'subdomain' for Subdomains
add_filter('post_add_domain', 'my_post_add_domain', 10, 3);
function my_post_add_domain($user, $domain, $domain_data){
if($domain_data['type'] == 'doamin_type'){
//code
//Write your code here
}
}pre_edit_domain
The pre_edit_domain filter will trigger your function right before Domain is edited.
To call filer for different type of domain you have to pass type of domain name
For parked domains $domain_data['type'] == 'parked', pass 'addon' for Addon domain and 'subdomain' for Subdomains
//FILTER to call specific function
add_filter('pre_edit_domain', 'my_pre_edit_domain', 10, 4);
function my_pre_edit_domain($user, $domain, $document_root, $domain_data){
if($domain_data['type'] == 'domain_type'){
//code
//Write your code here
}
}post_edit_domain
The post_edit_domain filter will trigger your function after a Domain is edited.
To call filer for different type of domain you have to pass type of domain name
For parked domains $domain_data['type'] == 'parked', pass 'addon' for Addon domain and 'subdomain' for Subdomains
//FILTER to call specific function
add_filter('post_edit_domain', 'my_post_edit_domain', 10, 4);
function my_post_edit_domain($user, $domain, $document_root, $domain_data){
if($domain_data['type'] == 'domain_type'){
//code
//Write your code here
}
}Create_user
The create_account filter will trigger after user creation or edit user
$data will be an array containing all users data
add_filter('create_user', 'post_create_user', 100, 1);
function post_create_user($data){
// $data is an array containing users data
}Post_delete_user
The post_delete_user filter will trigger after user deletion
bgcl_filter('post_delete_user', 'post_delete_user');
function post_delete_user($user, $userdata){
// $userdata is an array containing users data
// $user will be username
}