WP_Locale::get_weekday() WordPress Method

The WP_Locale::get_weekday() function is used to retrieve the translated weekday names. The function accepts an integer representing the day of the week (0 for Sunday, 1 for Monday, etc.) and returns the translated name of the day.

WP_Locale::get_weekday( int $weekday_number ) #

Retrieves the full translated weekday word.


Description

Week starts on translated Sunday and can be fetched by using 0 (zero). So the week starts with 0 (zero) and ends on Saturday with is fetched by using 6 (six).


Top ↑

Parameters

$weekday_number

(int)(Required)0 for Sunday through 6 Saturday.


Top ↑

Return

(string) Full translated weekday.


Top ↑

Source

File: wp-includes/class-wp-locale.php

	public function get_weekday( $weekday_number ) {
		return $this->weekday[ $weekday_number ];
	}


Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.