acf_field_date_picker::input_admin_enqueue_scripts()publicACF 5.3.2

input_admin_enqueue_scripts

description

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

Хуков нет.

Возвращает

$post_id. (int)

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

$acf_field_date_picker = new acf_field_date_picker();
$acf_field_date_picker->input_admin_enqueue_scripts();

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

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

Код acf_field_date_picker::input_admin_enqueue_scripts() ACF 6.0.4

function input_admin_enqueue_scripts() {

	// bail early if no enqueue
	if ( ! acf_get_setting( 'enqueue_datepicker' ) ) {
		return;
	}

	// localize
	global $wp_locale;
	acf_localize_data(
		array(
			'datePickerL10n' => array(
				'closeText'       => _x( 'Done', 'Date Picker JS closeText', 'acf' ),
				'currentText'     => _x( 'Today', 'Date Picker JS currentText', 'acf' ),
				'nextText'        => _x( 'Next', 'Date Picker JS nextText', 'acf' ),
				'prevText'        => _x( 'Prev', 'Date Picker JS prevText', 'acf' ),
				'weekHeader'      => _x( 'Wk', 'Date Picker JS weekHeader', 'acf' ),
				'monthNames'      => array_values( $wp_locale->month ),
				'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
				'dayNames'        => array_values( $wp_locale->weekday ),
				'dayNamesMin'     => array_values( $wp_locale->weekday_initial ),
				'dayNamesShort'   => array_values( $wp_locale->weekday_abbrev ),
			),
		)
	);

	// script
	wp_enqueue_script( 'jquery-ui-datepicker' );

	// style
	wp_enqueue_style( 'acf-datepicker', acf_get_url( 'assets/inc/datepicker/jquery-ui.min.css' ), array(), '1.11.4' );
}