WordPress.org

Ready to get started?Download WordPress

Codex

Class Reference/WP Customize Control

This class is used with the Theme Customization API to render an input control on the Theme Customizer in WordPress 3.4 or newer.

$wp_customize->add_control(
    new WP_Customize_Control(
        $wp_customize,
        'your_setting_id',
        array(
            'label'          => __( 'Dark or light theme version?', 'theme_name' ),
            'section'        => 'your_section_id',
            'settings'       => 'your_setting_id',
            'type'           => 'radio',
            'choices'        => array(
                'dark'   => __( 'Dark' ),
                'light'  => __( 'Light' )
            )
        )
    )
);

Input Types

With this class you can create the following input types:

  • text (default)
  • checkbox
  • radio (requires choices array in $args)
  • select (requires choices array in $args)
  • dropdown-pages


See also index of Class Reference and index of Function Reference.