The "dropdown-pages" control

Learn how to create controls using Kirki

Back to Controls

Returnsint

The documentation site is currently being rewritten. If you can't find what you're looking for please check the github issues and ask for assistance there until the documentation rewrite is complete.

Exactly the same as select controls.

The only difference is that the field type is defined as dropdown-pages and it will show a list of your pages. As a result, you don’t have to manually define the choices argument as it will be auto-populated using your pages.

The default value for dropdown-pages controls can be a page ID (int).

example: 'default' => 42, The returned value is the ID of the selected page.

Example

Kirki::add_field( 'theme_config_id', array(
	'type'        => 'dropdown-pages',
	'settings'    => 'my_setting',
	'label'       => esc_attr__( 'This is the label', 'textdomain' ),
	'section'     => 'section_id',
	'default'     => 42,
	'priority'    => 10,
) );
Edit this page