From e2166de4b0321a15c60c1182ede44938fa140ba1 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 5 Jan 2017 01:53:43 +0000 Subject: [PATCH] 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. Fixes #39368 for trunk. Built from https://develop.svn.wordpress.org/trunk@39678 git-svn-id: http://core.svn.wordpress.org/trunk@39618 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-editor.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index 916be4d9d4..1d2c75c113 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -681,8 +681,10 @@ final class _WP_Editors { $body_class .= ' post-format-standard'; } - if ( $page_template = get_page_template_slug( $post ) ) { - $page_template = str_replace( '.', '-', basename( $page_template, '.php' ) ); + $page_template = get_page_template_slug( $post ); + + 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 ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index f5428b5683..8de301bb23 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39677'; +$wp_version = '4.8-alpha-39678'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.