[wp-trac] [WordPress Trac] #57131: get_the_terms(): Parameter #1 ($post) of type is nullable.

WordPress Trac noreply at wordpress.org
Fri Nov 18 01:04:58 UTC 2022


#57131: get_the_terms(): Parameter #1 ($post) of type is nullable.
-----------------------------------+------------------------------
 Reporter:  omaeyusuke             |       Owner:  (none)
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Taxonomy               |     Version:  3.6
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  docs
-----------------------------------+------------------------------

Comment (by omaeyusuke):

 I have rethought my current implementation and understand that
 `get_post()` is only used to check for the existence of posts, and that
 receiving `WP_Post` is an extra if we are talking about implementation
 alone.
 However, if I make it not-nullable, the current implementation of
 `get_the_category()` breaks. There is a way to rewrite it, which is what
 I'm trying to do.

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


More information about the wp-trac mailing list