Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample code for an adblocker check based on BlockAlyzer for WordPress
function adblock_alert(){
?><script type="text/javascript">
jQuery(document).ready(function($) {
setTimeout(function(){
if ( ba_blocked == true ) alert("You are using adblock.");
},200)
});
</script><?php
}
add_action('wp_footer', 'adblock_alert');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment