Filters

Want to customize the settings from your theme then use the following code.

/**
 * Filter to disable all customize the settings.
 * 
 * @param array $settings
 */

 add_filter( 'adb/modify/settings', function($settings){
        $settings['enable'] = false;
 	return $settings;
 });

Customizing Icons

You can customize icon shown in modal also. To customize the modal, You have to use following file hooks

/**
 * Filter to change icon url
 * 
 * @param string $icon
 * @return string $icon
 */

 add_filter( 'adb/change/icon', function($icon){
        //change your icon
 	return $icon;
 });
/**
 * Filter to change icon image alt tag
 * 
 * @param string $title
 * @return string $title
 */

 add_filter( 'adb/change/icon/alt', function($title){
        //change your image description
 	return $title;
 });
/**
 * Filter to change icon image html code
 * 
 * @param string $html,$icon,$alt
 * @return string $html
 */

 add_filter( 'adb/change/html/icon', function($html, $icon, $alt){
        //customize your icon
 	return $html;
 }, 10, 3);

Request Time Interval

From Version V2.5.5, You can customize script time interval to check adblock. By default, It is 0.1 second i.e 100 milliseconds. You can customize this by adding below code.

Note: Your time interval must be in milliseconds.
1 seconds = 1000 milliseconds

/**
 * Filter to change Request Time Interval
 * 
 * @param int $time
 * @return int $time
 */

 add_filter( 'adb/check/interval', function($time){
 	return 1000;
 });

Debugging

From Version V2.5.5, You can debug the script performance in website. Just add the below code on your theme’s functions file. Then after your can see log in browser console tab.

/**
 * Debugging JS code
 * 
 * @param boolean $enable
 * @return boolean $enable
 */

 add_filter( 'adb/debug/js', function($enable){
 	return true;
 });

Join Our Newsletter Now

Get the latest tutorials, examples and projects updates.