Upload

The Upload control is identical to the Image control, the only difference is that it allows uploading more file types.

Kirki image

Example

new \Kirki\Field\Upload(
	[
		'settings'    => 'upload_setting',
		'label'       => esc_html__( 'Upload Control', 'kirki' ),
		'description' => esc_html__( 'The saved value will the URL.', 'kirki' ),
		'section'     => 'section_id',
	]
);

Usage

<?php
	$file_url = get_theme_mod( 'upload_setting', '' );
	printf( esc_html__( 'URL of uploaded file: %s', 'kirki' ), $file_url );
?>

Was this helpful?