Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#53579 closed enhancement (wontfix)

Apparently unused condition in template-parts/content/content.php

Reported by: sgr33n's profile SGr33n Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords:
Focuses: template Cc:

Description

Hi,
On template-parts/content/content.php we have a condition {{{#!php
<?php
if ( is_singular() ) :
}}}

But looks like that the inclusion of this file never met that condition.

Change History (3)

#1 @poena
3 years ago

Hi!
Can you help me understand which theme you are referring to?

#2 @SergeyBiryukov
3 years ago

Hi there, thanks for the ticket!

This appears to apply to Twenty Nineteen and Twenty Twenty-One.

Both themes have an is_singular() condition in the template-parts/content/content.php file. However, both themes also have a separate template-parts/content/content-single.php file for single posts.

So it seems that the condition is indeed unused. That said, we can't predict how these templates might be reused in child themes, so it seems safer to keep the condition just in case, I don't see any harm in it.

#3 @desrosj
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I tend to agree with leaving them as is.

Note: See TracTickets for help on using tickets.