WordPress at a glance
function is not described

WP_Customize_Date_Time_Control::get_month_choices() public WP 4.9.0

Generate options for the month Select.

Based on touch_time().

{} It's a method of the class: WP_Customize_Date_Time_Control{}

No Hooks.

Return

Array.

Usage

$WP_Customize_Date_Time_Control = new WP_Customize_Date_Time_Control();
$WP_Customize_Date_Time_Control->get_month_choices();

Notes

  • See: touch_time()
  • Global. WP_Locale. $wp_locale WordPress date and time locale object.

Changelog

Since 4.9.0 Introduced.

Code of WP_Customize_Date_Time_Control::get_month_choices() WP 5.7.2

<?php
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,
	);
}