mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
Comments: Restore the fourth parameter of comments_number() as $post_id, for consistency with get_comments_number_text().
The parameter was previously used as the number of comments, marked as deprecated in [5101]. Given that it's been deprecated for the last 13 years, it should be safe to undeprecate and repurpose it for a cleaner function signature, instead of adding a fifth parameter. Follow-up to [47276]. Fixes #48772. git-svn-id: https://develop.svn.wordpress.org/trunk@47366 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -40,6 +40,13 @@ class Tests_Comment_Template extends WP_UnitTestCase {
|
||||
$comments_number_text = get_comments_number_text( false, false, false, $post_id );
|
||||
|
||||
$this->assertEquals( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text );
|
||||
|
||||
ob_start();
|
||||
comments_number( false, false, false, $post_id );
|
||||
$comments_number_text = ob_get_clean();
|
||||
|
||||
$this->assertEquals( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user