monsterinsights_admin_styles

Loads styles for all MonsterInsights-based Administration Screens.

Description

(null) monsterinsights_admin_styles(); 

Returns (null)

Return early if not on the proper screen.


Usage

  1. if ( !function_exists( 'monsterinsights_admin_styles' ) ) { 
  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_admin_styles(); 
  7.  

Defined (1)

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

/includes/admin/common.php  
  1. function monsterinsights_admin_styles() { 
  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. // Maps 
  11. wp_register_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-jvectormap-style', plugins_url( 'assets/css/jvectormap/jquery-jvectormap-2.0.3.css', MONSTERINSIGHTS_PLUGIN_FILE ), array(), monsterinsights_get_asset_version() ); 
  12. wp_enqueue_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-jvectormap-style' ); 
  13.  
  14. // FontAwesome (used for message boxes) 
  15. wp_register_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-font-awesome', plugins_url( 'assets/css/font-awesome/font-awesome.min.css', MONSTERINSIGHTS_PLUGIN_FILE ), array(), monsterinsights_get_asset_version() ); 
  16. wp_enqueue_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-font-awesome' ); 
  17.  
  18. // Select300 
  19. wp_register_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-select300-style', plugins_url( 'assets/css/select300/select300.css', MONSTERINSIGHTS_PLUGIN_FILE ), array(), monsterinsights_get_asset_version() ); 
  20. wp_enqueue_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-select300-style' ); 
  21.  
  22. // Tooltips 
  23. wp_enqueue_script( 'jquery-ui-tooltip' ); 
  24.  
  25. // Load necessary admin styles. 
  26. $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; 
  27. if ( ! file_exists( MONSTERINSIGHTS_PLUGIN_DIR . 'assets/css/admin.min.css' ) ) { 
  28. $suffix = ''; 
  29. wp_register_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-admin-style', plugins_url( 'assets/css/admin' . $suffix . '.css', MONSTERINSIGHTS_PLUGIN_FILE ), array(), monsterinsights_get_asset_version() ); 
  30. wp_enqueue_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-admin-style' ); 
  31.  
  32. // See if there's an admin.css file for this plugin version 
  33. if ( file_exists( MONSTERINSIGHTS_PLUGIN_DIR . 'pro/assets/css/admin.css' ) ) { 
  34. wp_register_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-pro-admin-style', plugins_url( 'pro/assets/css/admin.css', MONSTERINSIGHTS_PLUGIN_FILE ), array(), monsterinsights_get_asset_version() ); 
  35. wp_enqueue_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-pro-admin-style' ); 
  36. } else if ( file_exists( MONSTERINSIGHTS_PLUGIN_DIR . 'lite/assets/css/admin.css' ) ) { 
  37. wp_register_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-only-admin-style', plugins_url( 'lite/assets/css/admin.css', MONSTERINSIGHTS_PLUGIN_FILE ), array(), monsterinsights_get_asset_version() ); 
  38. wp_enqueue_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-only-admin-style' );