WordPress.org

Make WordPress Core

Changeset 39678


Ignore:
Timestamp:
01/05/2017 01:52:06 AM (3 years ago)
Author:
azaozz
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r38970 r39678  
    682682                }
    683683
    684                 if ( $page_template = get_page_template_slug( $post ) ) {
    685                     $page_template = str_replace( '.', '-', basename( $page_template, '.php' ) );
     684                $page_template = get_page_template_slug( $post );
     685
     686                if ( $page_template !== false ) {
     687                    $page_template = empty( $page_template ) ? 'default' : str_replace( '.', '-', basename( $page_template, '.php' ) );
    686688                    $body_class .= ' page-template-' . sanitize_html_class( $page_template );
    687689                }
Note: See TracChangeset for help on using the changeset viewer.