Is there any way to add placeholder for WordPress Customizer text input fields

You can use the input_attrs argument to pass attributes to the input:

$wp_customize->add_control('directorist_address', array(
        'label' => __('Address', 'directorist'),
        'section' => 'directorist_contact',
        'settings' => 'directorist_address',
        'description' => __('Enter your contact address. Eg. Abc Business Center, 123 Road, London, England', 'directorist' ),
        'input_attrs' => array(
            'placeholder' => __( 'Placeholder goes here...', 'directorist' ),
        )
    )
);

Leave a Comment