Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#54851 new defect (bug)

Prevent unnecessary code comments from being output to the front end

Reported by: kjellr's profile 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:

https://github.com/WordPress/wordpress-develop/blob/a0b1f27de6c928fde51bbc7078b32ca9c9d6ed8d/src/wp-includes/theme-compat/comments.php#L30-L75

This includes some code comments that may be useful for developers, but don't actually need to be send to the front end:

http://cldup.com/ebPNDuXdBe.png

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

Change History (1)

#1 @parinpanjari
2 years ago

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

Last edited 2 years ago by parinpanjari (previous) (diff)
Note: See TracTickets for help on using tickets.