Skip to content

Instantly share code, notes, and snippets.

@webzunft
Created February 18, 2014 19:54
Show Gist options
  • Save webzunft/9078689 to your computer and use it in GitHub Desktop.
Save webzunft/9078689 to your computer and use it in GitHub Desktop.
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