
number
controls are simple numeric fields that only accept numbers as input and not free text.
Example
Kirki::add_field( 'theme_config_id', [
'type' => 'number',
'settings' => 'number_setting',
'label' => esc_html__( 'This is the label', 'kirki' ),
'section' => 'section_id',
'default' => 42,
'choices' => [
'min' => 0,
'max' => 80,
'step' => 1,
],
] );
Usage
<div style="font-size: <?php echo get_theme_mod( 'number_setting', 14 ); ?>px">
<p>The font-size of this paragraph is controlled by "number_setting".</p>
</div>