From 7e17787f4734a1530b1ad3e7c14862eec951f4c8 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 26 Aug 2013 18:18:09 +0000 Subject: [PATCH] Add post-type-$post_type and taxonomy-$taxonomy admin body classes. props johnbillion. fixes #19247. Built from https://develop.svn.wordpress.org/trunk@25124 git-svn-id: http://core.svn.wordpress.org/trunk@25104 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-header.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 93d653cff6..6c743c4a55 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -80,6 +80,12 @@ if ( is_admin_bar_showing() ) if ( is_rtl() ) $admin_body_class .= ' rtl'; +if ( $current_screen->post_type ) + $admin_body_class .= ' post-type-' . $current_screen->post_type; + +if ( $current_screen->taxonomy ) + $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; + $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );