Make WordPress Core

Changeset 39679 for branches/4.7


Ignore:
Timestamp:
01/05/2017 01:58:57 AM (8 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.
Merges [39678] to the 4.7 branch.
Fixes #39368.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/class-wp-editor.php

    r38970 r39679  
    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.