Improve the Site Editor preview for PHP templates
What problem does this address?
If you activate a hybrid theme, or a classic theme that is a child theme of a block theme, the PHP page template files can not be edited in the Site Editor. This is a current fact, that may be apparent for developers/designers and advanced users, but not to all.
- If you are on the front of the site, and you are viewing content that uses a PHP template, and you click on the "Edit Site" link in the top toolbar,
- If you are in the admin area, and you open Appearance > Editor,
Then the Site Editor preview opens but it is empty except for the loading animation. It looks like it is trying to load the template, but nothing happens. I am testing this on macOS.
What is your proposed solution?
It may be better to display a message saying that this template can not be previewed.
Instructions
Create a new classic child theme and set the parent to twentytwentyfour. Add a index.php and a home.php template in the theme folder of the child theme. Activate the child theme. Open the Site Editor and view the preview.
How about using the <Warning>? (With or without the loader)
Hi, This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.
Closing as a duplicate, in favor of https://github.com/WordPress/gutenberg/issues/64341