Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#58658 new enhancement

WP_Locale add get_month_genitive() method

Reported by: tkama's profile Tkama Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 4.4
Component: I18N Keywords:
Focuses: Cc:

Description

The WP_Locale class has get_month() and get_month_abbrev() methods, but does not have get_month_genitive(). It should be there as well.

We should add such a code:

	/**
	 * Retrieves the full translated month in genitive case by month number.
	 *
	 * @since 6.2.3
	 *
	 * @param string|int $month_number  From 1 to 12. If a number less than 10 is
	 *                                  passed in integer or string format, a '0' will be added before it.
	 *
	 * @return string Translated full month name in genitive case.
	 */
	public function get_month_genitive( $month_number ) {
		return $this->month_genitive[ zeroise( $month_number, 2 ) ];
	}

Attachments (1)

diff.patch (1.1 KB) - added by Tkama 5 months ago.

Download all attachments as: .zip

Change History (2)

@Tkama
5 months ago

#1 @SergeyBiryukov
5 months ago

  • Component changed from General to I18N
  • Version changed from 6.2.2 to 4.4

Thanks for the ticket! Setting the version to 4.4 as per [35517] / #11226.

Note: See TracTickets for help on using tickets.