Add post-type-$post_type and taxonomy-$taxonomy admin body classes.

props johnbillion.
fixes #19247.


git-svn-id: https://develop.svn.wordpress.org/trunk@25124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-08-26 18:17:23 +00:00
parent a679d43131
commit 42dee6ccf0

View File

@ -80,6 +80,12 @@ if ( is_admin_bar_showing() )
if ( is_rtl() ) if ( is_rtl() )
$admin_body_class .= ' 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 .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );
$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $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' ); $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );