Always add `page-template-default` class to the editor body when the template is not specified. This matches the behavior on the front-end.

Props timph (for the detailed bug report), azaozz.
Merges [39678] to the 4.7 branch.
Fixes #39368.
Built from https://develop.svn.wordpress.org/branches/4.7@39679


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2017-01-05 01:59:38 +00:00
parent 6124fbb02c
commit ce7ab0d87f
2 changed files with 5 additions and 3 deletions

View File

@ -681,8 +681,10 @@ final class _WP_Editors {
$body_class .= ' post-format-standard'; $body_class .= ' post-format-standard';
} }
if ( $page_template = get_page_template_slug( $post ) ) { $page_template = get_page_template_slug( $post );
$page_template = str_replace( '.', '-', basename( $page_template, '.php' ) );
if ( $page_template !== false ) {
$page_template = empty( $page_template ) ? 'default' : str_replace( '.', '-', basename( $page_template, '.php' ) );
$body_class .= ' page-template-' . sanitize_html_class( $page_template ); $body_class .= ' page-template-' . sanitize_html_class( $page_template );
} }
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7.1-alpha-39664'; $wp_version = '4.7.1-alpha-39679';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.