[wp-trac] [WordPress Trac] #53579: Apparently unused condition in template-parts/content/content.php

WordPress Trac noreply at wordpress.org
Sat Jul 3 11:19:04 UTC 2021


#53579: Apparently unused condition in template-parts/content/content.php
---------------------------+------------------------------
 Reporter:  SGr33n         |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  template
---------------------------+------------------------------

Comment (by SergeyBiryukov):

 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.

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


More information about the wp-trac mailing list