WordPress 4.7.1
[autoinstalls/wordpress.git] / wp-includes / class-wp-editor.php
index 916be4d9d4b73fae6fbd779f67bd3f8c796dcd7e..1d2c75c113988afc25a4c7eae2cf478d481cc918 100644 (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 = 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 );
                                }
                        }
                                        $body_class .= ' page-template-' . sanitize_html_class( $page_template );
                                }
                        }