.page-template-default body class in editor doesn't appear in initial post/page load.
|Reported by:||timph||Owned by:||azaozz|
The class .page-template-default isn't in tinymce editor body classes on initial load if default template is used. It was causing some odd behaviors when I was testing some themes out. This was because the themes were adding specific styles for .page-template-default. This class seems to only get added when you select a template from Page Attributes > Default, and there were some major visual differences from initial page load to what would be seen when selecting that template from page attributes. I think for consistency it should be present if that's the template in use.
- Add a page template to the theme. Mine was page-home.php
- Add a new page. This should use the default template.
- Inspect the body classes of the editor, there's no class added to designate this is the page-template-default at this point.
- Under Page Attributes, select Home. Inspect the body classes, you'll see page-template-page-home is applied.
- Select the Default template, you'll see page-template-default is applied and page-template-page-home is removed.
- Select the home page template again.
- Publish the page. Inspect the body class you'll see it's still there. Refresh the page. It's still there.
- Select the default template, then update the page and refresh. You'll see that the class is no longer present.
Change History (7)
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 4.7.1
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed