sven
8/12/2013 - 7:51 AM

Building a responsive WordPress admin interface with the MP6 plugin and customized Dashicons.

Building a responsive WordPress admin interface with the MP6 plugin and customized Dashicons.

<?php

  function check_active_plugins() {
    if ( is_plugin_active( 'mp6/mp6.php' ) ) {
      function load_custom_admin_styles() {
        wp_register_style( 'custom_dashicons', get_template_directory_uri() . '/css/custom_dashicons.css', false, '1.0.0' );
        wp_enqueue_style( 'custom_dashicons' );
      }
      add_action( 'admin_enqueue_scripts', 'load_custom_admin_styles' );
    } 
  }
  add_action( 'admin_init', 'check_active_plugins' );

?>
<?php

  function load_custom_admin_styles() {
    wp_register_style( 'custom_dashicons', get_template_directory_uri() . '/css/custom_dashicons.css', false, '1.0.0' );
    wp_enqueue_style( 'custom_dashicons' );
  }
  add_action( 'admin_enqueue_scripts', 'load_custom_admin_styles' );

?>
<?php

  if ( 'mp6' === get_user_option( 'admin_color' ) ) {
    function load_custom_admin_styles() {
      wp_register_style( 'custom_dashicons', get_template_directory_uri() . '/css/custom_dashicons.css', false, '1.0.0' );
      wp_enqueue_style( 'custom_dashicons' );
    }
    add_action( 'admin_enqueue_scripts', 'load_custom_admin_styles' );
  }

?>
@font-face {
  font-family: 'custom_dashicons';
  src: url('../fonts/custom_dashicons.eot'); // this is for IE
}
@font-face {
  font-family: 'custom_dashicons';
  src: url(data:application/font-woff;charset=utf-8;base64,xxx...) format('woff'), 
    url(data:application/x-font-ttf;charset=utf-8;base64,xxx...) format('truetype');
  font-weight: normal;
  font-style: normal;
}
#dashboard_right_now li.{post_type}-count a:before,
#adminmenu #menu-posts-{post_type}.menu-icon-post div.wp-menu-image:before {
  font-family: 'custom_dashicons' !important;
  content: '\999';
}