[wp-trac] [WordPress Trac] #63263: check if exists before accessing object properties of $post->comment_count

WordPress Trac noreply at wordpress.org
Wed Oct 22 17:20:01 UTC 2025


#63263: check if exists before accessing object properties of $post->comment_count
---------------------------------------------+--------------------------
 Reporter:  Presskopp                        |       Owner:  westonruter
     Type:  defect (bug)                     |      Status:  assigned
 Priority:  normal                           |   Milestone:  6.9
Component:  General                          |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  needs-test-info has-screenshots  |     Focuses:
---------------------------------------------+--------------------------

Comment (by johnjamesjacoby):

 This happens specifically when `show_on_front` is set, because the
 "Queried Object" is the Page ID of the Posts landing page, which makes
 `is_singular()` return true.

 Patch incoming.

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


More information about the wp-trac mailing list