diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 7145a21d16..6535af15ab 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -615,7 +615,14 @@ function get_body_class( $class = '' ) { } if ( is_page_template() ) { $classes[] = 'page-template'; - $classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', get_page_template_slug( $page_id ) ) ); + + $template_slug = get_page_template_slug( $page_id ); + $template_parts = explode( '/', $template_slug ); + + foreach ( $template_parts as $part ) { + $classes[] = 'page-template-' . sanitize_html_class( str_replace( array( '.', '/' ), '-', basename( $part, '.php' ) ) ); + } + $classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', $template_slug ) ); } else { $classes[] = 'page-template-default'; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 1c14ea9beb..b012a7bb58 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-30099'; +$wp_version = '4.1-alpha-30100'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.