Make WordPress Core

Opened 6 years ago

Closed 16 months ago

#10177 closed enhancement (fixed)

get_ version of comments_number()

Reported by: nbachiyski Owned by: wonderboymusic
Milestone: 4.0 Priority: normal
Severity: normal Version: 2.8
Component: Comments Keywords: has-patch i18n
Focuses: template Cc:


Currently: comments_number() accepts several arguments for the comment number labels and outputs them. get_comments_number(), however, returns only the number of comments.

Problem: there isn't a function to mimic the comments_number() functionality, but to return instead of echo.

The patch introduces get_comments_number_text(), which inherits the functionality of comments_number(), but returns. comments_number() just calls get_comments_number_text().

Attachments (3)

get-comments-number-text.diff (1.4 KB) - added by nbachiyski 6 years ago.
10177.diff (1.3 KB) - added by kapeels 5 years ago.
10177.2.diff (1.9 KB) - added by wonderboymusic 16 months ago.

Download all attachments as: .zip

Change History (12)

#1 @ryan
6 years ago

  • Milestone changed from 2.9 to 3.0

#2 @nacin
6 years ago

  • Keywords early added
  • Milestone changed from 3.0 to 3.1
  • Type changed from defect (bug) to enhancement

#3 @nacin
5 years ago

  • Milestone changed from Awaiting Triage to 3.1

Instead of call_user_func_array() it would be cleaner to just pass the three arguments.

#4 @westi
5 years ago

  • Milestone changed from 3.1 to Future Release

Moving to Future Release as it is an enhancement.

#5 @kapeels
5 years ago

  • Cc kapeel.sable@… added
  • Keywords 2nd-opinion added

Would be great if you guys could give me points in gci for this bug-fix :)

5 years ago

#6 @nacin
21 months ago

  • Component changed from Template to Comments
  • Focuses template added

#7 @obenland
18 months ago

  • Keywords needs-refresh added; early 2nd-opinion removed

#8 @wonderboymusic
16 months ago

  • Keywords needs-refresh removed
  • Milestone changed from Future Release to 4.0

10177.2.diff does it.

#9 @wonderboymusic
16 months ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 28912:

Add a function, get_comments_number_text(), that returns instead of echoing. comments_number() wraps it.

Props kapeels, nbachiyski.
Fixes #10177.

Note: See TracTickets for help on using tickets.