Disabling adblock alert for specific user role
-
Hello, first of all thank you for this plugin, it works perfectly.
I provide ad-free membership in my website. So I want to disable adblock alert for “Subscriber” user role.I tried to deregister js and css files by adding the following code to the functions.php file, but it didn’t work. Can you provide a solution?
function adblock_dequeue_styles() { if ( current_user_can( 'subscriber' ) ) { wp_dequeue_script( 'chp-ads-alerty-js' ); wp_dequeue_style( 'chp-ads-alerty-css' ); } } add_action( 'wp_print_styles', 'adblock_dequeue_styles' );
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Disabling adblock alert for specific user role’ is closed to new replies.