buy
Filters

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.

NOTE:
To call filter you have to create the filter.php file in the following path.
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.

pre_add_domain

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
	}
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list