Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#53579 closed enhancement (wontfix)

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

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

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
5 years ago

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

#2 @SergeyBiryukov
5 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
5 years ago

  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status newclosed

I tend to agree with leaving them as is.

Note: See TracTickets for help on using tickets.