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

WordPress Trac noreply at wordpress.org
Fri Oct 24 03:30:50 UTC 2025


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

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"61056" 61056]:
 {{{
 #!CommitTicketReference repository="" revision="61056"
 General: Improve resilience of `feed_links_extra()` when global `$post` is
 not set.

 This obtains the global post via `get_queried_object()` when
 `is_singular()`.

 Developed in https://github.com/WordPress/wordpress-develop/pull/10401

 Props westonruter, johnjamesjacoby, Presskopp, abcd95, dilipbheda,
 sabernhardt, awetz583, indirabiswas27.
 Fixes #63263.
 }}}

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


More information about the wp-trac mailing list