On this page
WP_Customize_Date_Time_Control::get_month_choices(): array
Generate options for the month Select.
Description
Based on touch_time() .
See also
Return
array
Source
File: wp-includes/customize/class-wp-customize-date-time-control.php. View all references
public function get_month_choices() {
global $wp_locale;
$months = array();
for ( $i = 1; $i < 13; $i++ ) {
$month_text = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );
/* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */
$months[ $i ]['text'] = sprintf( __( '%1$s-%2$s' ), $i, $month_text );
$months[ $i ]['value'] = $i;
}
return array(
'month_choices' => $months,
);
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Locale::get_month() wp-includes/class-wp-locale.php | Retrieves the full translated month by month number. |
| WP_Locale::get_month_abbrev() wp-includes/class-wp-locale.php | Retrieves translated version of month abbreviation string. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
Used By
| Used By | Description |
|---|---|
| WP_Customize_Date_Time_Control::content_template() wp-includes/customize/class-wp-customize-date-time-control.php | Renders a JS template for the content of date time control. |
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_date_time_control/get_month_choices