[wp-trac] [WordPress Trac] #52322: Add comment / comment id param to get_comment_time

WordPress Trac noreply at wordpress.org
Tue Nov 15 15:39:02 UTC 2022


#52322: Add comment / comment id param to get_comment_time
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  audrasjb
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.2
Component:  Comments                             |     Version:  1.5
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch needs-      |     Focuses:
  refresh changes-requested                      |
-------------------------------------------------+-------------------------

Comment (by rudlinkon):

 Replying to [comment:2 SergeyBiryukov]:
 > Thanks for the patch! Some notes:
 >
 > * The new parameter should be added at the end. Adding it after
 `$format` matches `get_comment_date()`, but is not feasible in practice,
 as it would break backward compatibility.
 > * The DocBlock should be aligned per the
 [https://developer.wordpress.org/coding-standards/inline-documentation-
 standards/php/ documentation standards] and would also need a
 [https://developer.wordpress.org/coding-standards/inline-documentation-
 standards/php/#since-section-changelogs @since note].
 > * `comment_time()` would probably need a similar change for consistency.

 Yes, I agree with @SergeyBiryukov that we need a similar change in
 `comment_time()` for consistency. Also, we can add the same extra
 parameter `$comment_ID` on the `get_comment_time` filter so that developer
 can get a direct comment id instead of getting it from the `$comment`
 object.

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


More information about the wp-trac mailing list