Launch Offer – Kirki PRO is now available! 🚀Get it while it lasts!

Code

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

Last updated on: January 21st, 2022

Scroll to Top

Download

Subscribe & be the first to be informed about
new features & updates!