Introduction

REMINDER

You shouldn't use Handy if you are unfamiliar with the PHP and WordPress Customizer API.

What is Handy?

Handy is a tool for WordPress Theme Developers to develop themes using the Customizer API while writing clean and minimal code.

Why should use Handy?

Handy is developed to help WordPress Theme Developers to use the Customizer API while writing minimal, maintainable code and to avoid repetition of code.

How to install?

For your WordPress theme project, there are two approaches to install Handy. The first choice is to add it to your WordPress plugin directory, the second is to include it into your theme. If you intend to publish your theme, the second option is recommended. Please read Installation for additional information on installation.

Demonstration

After you successfully installed Handy in your WordPress theme project, you can now create a panel, section, and control. In order to add those components, add the following codes in theme functions.php.

The first is to add a panel. For further information on the panel parameters, please read Panel.

 
Handy::panel([
    'id'          => 'panel_id',
    'title'       => esc_html__( 'Panel', 'textdomain' ),
    'description' => esc_html__( 'Description Here', 'textdomain' )
]);

The second step is to insert a section within a panel. Copy the id of the panel and supply it to the panel parameter of the section. For further information on the section parameters, please read Section.

 
Handy::section([
    'id'          => 'section_id',
    'panel'       => 'panel_id',
    'title'       => esc_html__( 'Section', 'textdomain' ),
    'description' => esc_html__( 'Description Here', 'textdomain' )
]);

The last is to insert a control within a section. Copy the id of the section and supply it to the section parameter of the control. The example below will add a text control. For further information on the control parameters, please read Control.

 
Handy::field( 'text', [
    'id'          => 'text_id',
    'section'     => 'section_id',
    'label'       => esc_html__( 'Text', 'textdomain' ),
    'description' => esc_html__( 'Description Here', 'textdomain' ),
    'placeholder' => esc_html__( 'Text Placeholder', 'textdomain' )
]);