WP_Locale::get_monthpublicWP 2.1.0

Retrieves the full translated month by month number.

The $month_number parameter has to be a string because it must have the '0' in front of any number that is less than 10. Starts from '01' and ends at '12'.

You can use an integer instead and it will add the '0' before the numbers less than 10 for you.

Метод класса: WP_Locale{}

Хуков нет.

Возвращает

string. Translated full month name. If the month number is not found, an empty string is returned.

Использование

global $wp_locale;
$wp_locale->get_month( $month_number );
$month_number(строка|int) (обязательный)
'01' through '12'.

Список изменений

С версии 2.1.0 Введена.

Код WP_Locale::get_month() WP 7.1

public function get_month( $month_number ) {
	$month_number = zeroise( $month_number, 2 );
	if ( ! isset( $this->month[ $month_number ] ) ) {
		return '';
	}
	return $this->month[ $month_number ];
}