[wp-trac] [WordPress Trac] #62053: Warn logged in users when rendering empty template in the front end

WordPress Trac noreply at wordpress.org
Mon Nov 4 13:47:22 UTC 2024


#62053: Warn logged in users when rendering empty template in the front end
-------------------------+------------------------------
 Reporter:  vcanales     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Editor       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  template
-------------------------+------------------------------

Comment (by mikachan):

 I used the code editor to delete the blocks, and I can't see any white
 space left behind. I also tried adding blocks back in (just a paragraph
 block), saving, and then deleting this via the code editor again, and I
 still see a blank template when logged out.

 Just to clarify what I'm seeing in the code editor:

 [[Image(https://cldup.com/L1qKqoXYsY.png)]]

 In any case, I like the idea of defaulting to the theme's template when
 the user is logged out, so I've gone ahead and
 [https://github.com/WordPress/wordpress-
 develop/pull/7354/commits/76237fb1d07c033bde925b43aa3d512fde699069
 committed a change] to the PR that hopefully does this. To test (following
 your steps above):

 1. Activate 2025
 2. Open the site editor
 3. Edit the blog home page
 4. Switch to the code editor
 5. Delete all markup and save
 6. View the site while logged in: It should show the new, "This page is
 blank because the template might have been deleted..." warning message.
 7. View the site using a private/incognito window: If the template is
 included with the theme (like Blog Home), then it should default to the
 contents from the theme. If the template is not included with the theme,
 e.g. a custom template, it should show a blank template.

 I've also applied a wording change from @mrfoxtalbot in
 [https://github.com/WordPress/wordpress-
 develop/pull/7354/commits/5d23d4c813b670d33a4bac78eef1011588df3a5f this
 commit].

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62053#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list