The "date" control

Learn how to create controls using Kirki

Back to Controls

Returnsstring

Can't find what you're looking for? Check the github issues or edit this page to add what's missing.

The date control allows you to select a date.

The returned value is a string.

date control example

Example

<?php
Kirki::add_field( 'theme_config_id', [
	'type'        => 'date',
	'settings'    => 'date_setting',
	'label'       => esc_html__( 'Date Control', 'kirki' ),
	'description' => esc_html__( 'This is a date control.', 'kirki' ),
	'section'     => 'date_section',
	'default'     => '',
] );
?>

Usage

<?php
$date = get_theme_mod( 'date_setting', '2019-01-30' );
echo esc_html( $date );
?>
Edit this page