[wp-trac] [WordPress Trac] #25196: add new function get_comment_post_ID()

WordPress Trac noreply at wordpress.org
Wed Sep 4 21:23:27 UTC 2013


#25196: add new function get_comment_post_ID()
-------------------------+------------------------------
 Reporter:  alexvorn2    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Comments     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------

Comment (by nacin):

 Replying to [comment:2 nofearinc]:
 > I think that a function would be more elegant, but if we need it for a
 "custom" ID (randomly passed) then `get_comment()` would return `null` and
 calling a property of a null would result to a notice?

 But if you're trying to fetch the post ID of a comment that doesn't exist,
 surely you ''should'' get a notice?

 From another angle: What should be the return value of
 get_comment_post_ID() when the comment doesn't exist?

 I'm just not sure we need to add wrapper functions for every property of a
 post/comment/etc object. Now, in this case, it could qualify as a template
 tag — but is it one we honestly need?

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25196#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list