monsterinsights_remove_conflicting_asset_files

Remove Assets that conflict with ours from our screens.

Description

(null) monsterinsights_remove_conflicting_asset_files(); 

Returns (null)

Return early if not on the proper screen.


Usage

  1. if ( !function_exists( 'monsterinsights_remove_conflicting_asset_files' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/common.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = monsterinsights_remove_conflicting_asset_files(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/common.php  
  1. function monsterinsights_remove_conflicting_asset_files() { 
  2.  
  3. // Get current screen. 
  4. $screen = get_current_screen(); 
  5.  
  6. // Bail if we're not on a MonsterInsights screen. 
  7. if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) { 
  8. return; 
  9.  
  10. $styles = array( 
  11. 'kt_admin_css', // Pinnacle theme 
  12. 'select2-css', // Schema theme 
  13. 'tweetshare_style', // TweetShare - Click To Tweet 
  14. 'tweetshare_custom_style', // TweetShare - Click To Tweet 
  15. 'tweeetshare_font_script', // TweetShare - Click To Tweet 
  16. 'tweeetshare_jquery_script', // TweetShare - Click To Tweet 
  17. 'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet 
  18. 'tweeetshare_custom_script', // TweetShare - Click To Tweet 
  19. 'tweeetshare_custome_style', // TweetShare - Click To Tweet 
  20. 'tweeetshare_notice_style', // TweetShare - Click To Tweet 
  21. 'tweeetshare_theme_style', // TweetShare - Click To Tweet 
  22. 'tweeetshare_tweet_box_style', // TweetShare - Click To Tweet 
  23. ); 
  24.  
  25. $scripts = array( 
  26. 'kad_admin_js', // Pinnacle theme 
  27. ); 
  28.  
  29. foreach ( $styles as $style ) { 
  30. wp_dequeue_style( $style ); // Remove CSS file from MI screen 
  31.  
  32. foreach ( $scripts as $script ) { 
  33. wp_dequeue_script( $script ); // Remove JS file from MI screen