Skip to content

Instantly share code, notes, and snippets.

@screamingjungle
Created May 19, 2017 13:42
Show Gist options
  • Save screamingjungle/0f8108fab6b62288419dc5777b12921b to your computer and use it in GitHub Desktop.
Save screamingjungle/0f8108fab6b62288419dc5777b12921b to your computer and use it in GitHub Desktop.
Disable Wordpress Zopim/Zendesk Chat footer injection when Monitoring
<?php
/*
Plugin Name: Disable zopim when monitoring
Plugin URI: http://riotsupport.co.uk
Description: Removes zopim footer from pages with '--monitoring__tool__testing--' in the URL
Author: Matt Harvey
Version: 1.0
Author URI: http://riotsupport.co.uk
*/
add_action( 'wp_footer', 'lg_disable_zopim_plugin', 1 );
function lg_disable_zopim_plugin(){
if(strpos($_SERVER['REQUEST_URI'], '--monitoring__tool__testing--') > 0) {
remove_action( 'wp_footer', array( 'Zopim_Widget', 'zopimme' ));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment