[wp-trac] [WordPress Trac] #48772: Missing post ID as parameter for get_comments_number_text()

WordPress Trac noreply at wordpress.org
Thu Feb 20 22:25:18 UTC 2020


#48772: Missing post ID as parameter for get_comments_number_text()
------------------------------+-----------------------
 Reporter:  Hinjiriyo         |       Owner:  donmhico
     Type:  enhancement       |      Status:  reopened
 Priority:  normal            |   Milestone:  5.4
Component:  Comments          |     Version:  4.0
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+-----------------------

Comment (by garrett-eclipse):

 Thanks @SergeyBiryukov for the history. I tested
 [https://core.trac.wordpress.org/attachment/ticket/48772/48772.6.diff
 48772.6.diff] and prefer it rather than having to pass an empty string as
 fourth param just to be able to supply the fifth $post_id param. It
 applies cleanly and unit tests look good as well.

 That's great news it was deprecated 13 years ago in 1.3.0. In that case I
 would agree to drop it now and hopefully get that changed before 5.4
 launches or it'll be harder to go backwards.

 Dropping down to 4 attributes also helps avoid the need to switch to a
 $attr type of approach as proposed by @peterwilsoncc. I did look through
 the uses and implementation of the function and am unsure of any
 additional params that'd be desired. That being said I can't predict the
 future so if that's a safer way to move forward it makes sense.

 One last remark, I was wondering if we should utilize the fourth param to
 pass the `$id` to the instance of `comments_number` found here;
 https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes
 /comment-template.php#L1618
 *Note: If not provided will get a $post_id in `get_comments_number` using
 `get_post`

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


More information about the wp-trac mailing list