Opened 3 years ago
Last modified 3 years ago
#54851 new defect (bug)
Prevent unnecessary code comments from being output to the front end
Reported by: | kjellr | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | minor | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
Gutenberg's "Post Comments" block appears to pull its code from the WordPress' theme compat comments.php
file here:
This includes some code comments that may be useful for developers, but don't actually need to be send to the front end:
I'd suggest we change these from HTML comments to PHP comments, so they aren't visible in the outputted markup.
---
Related: https://github.com/WordPress/gutenberg/issues/37989
Tested with Gutenberg 12.4
WordPress 5.8.3
Note: See
TracTickets for help on using
tickets.
-> That effectively kills the line after it which is where "Comments are closed" is output, but without just deleting it completely.
if ( 0 && ! comments_open() ) :
-> simplest way is to find out the following line and delete or comment it.