Created
March 25, 2013 21:27
-
-
Save kfriend/5240927 to your computer and use it in GitHub Desktop.
Add post-type-derived class to Wordpress's admin <body>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// functions.php | |
add_filter('admin_body_class', function($classes) { | |
global $wpdb, $post; | |
if (is_admin()) | |
{ | |
$post_type = get_post_type($post->ID); | |
return $classes .= ' admin-type-'.$post_type; | |
} | |
return $classes; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment