Skip to content

Instantly share code, notes, and snippets.

@Yeadh
Forked from ajskelton/WP Customizer - Textarea
Created July 24, 2017 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yeadh/cf4fda8fd90dae0a298f67daff5a4d57 to your computer and use it in GitHub Desktop.
Save Yeadh/cf4fda8fd90dae0a298f67daff5a4d57 to your computer and use it in GitHub Desktop.
Add a Textarea field to the WordPress Customizer.
$wp_customize->add_setting( 'themeslug_textarea_setting_id', array(
'capability' => 'edit_theme_options',
'default' => 'Lorem Ipsum Dolor Sit amet',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'themeslug_textarea_setting_id', array(
'type' => 'textarea',
'section' => 'custom_section', // // Add a default or your own section
'label' => __( 'Custom Text Area' ),
'description' => __( 'This is a custom textarea.' ),
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment