The Code
control allows users to enter custom CSS, JS, HTML and more. This control uses the CodeMirror
library available in WordPress.
Example
new \Kirki\Field\Code(
[
'settings' => 'code_setting',
'label' => esc_html__( 'Code Control', 'kirki' ),
'description' => esc_html__( 'Description', 'kirki' ),
'section' => 'section_id',
'default' => '',
'choices' => [
'language' => 'css',
],
]
);
Usage
<?php echo get_theme_mod( 'code_setting', '' ); ?>