Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#56187 closed defect (bug) (fixed)

Wrong type in ngettext et al. filter description

Reported by: cyrillbolliger's profile cyrillbolliger Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.1 Priority: normal
Severity: trivial Version: 6.0
Component: I18N Keywords: good-first-bug has-patch
Focuses: docs Cc:


This ticket applies to wp-includes/l10n.php. It addresses only a documentation problem, the code works correctly.

The argument type of the $number argument of the following filters should be integer instead of string (in the docblock of the filter):

  • ngettext
  • ngettext_{$domain}
  • ngettext_with_context
  • ngettext_with_context_{$domain}

Else it contradicts the docblock of the following functions:

  • _n()
  • _nx()

Attachments (1)

56187.diff (2.6 KB) - added by cyrillbolliger 2 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
2 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 6.1

Hi there, welcome to WordPress Trac! Thanks for the ticket.

Good catch, introduced in [25565] / #25382.

Would you be interested in submitting a patch?

2 years ago

#2 @cyrillbolliger
2 years ago

  • Keywords has-patch added; needs-patch removed

#3 @SergeyBiryukov
2 years ago

Looks great, thanks!

#4 @SergeyBiryukov
2 years ago

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

In 53691:

Docs: Correct the type of the $number parameter in ngettext* filters.

This applies to:

  • ngettext
  • ngettext_{$domain}
  • ngettext_with_context
  • ngettext_with_context_{$domain}

Follow-up to [25565], [48136].

Props cyrillbolliger.
Fixes #56187.

#5 @cyrillbolliger
2 years ago

Thanks @SergeyBiryukov!

Note: See TracTickets for help on using tickets.