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).
Parameters
- $weekday_number
(int)(Required)0 for Sunday through 6 Saturday.
Return
(string) Full translated weekday.
Source
File: wp-includes/class-wp-locale.php
public function get_weekday( $weekday_number ) { return $this->weekday[ $weekday_number ]; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |