Last active
February 27, 2023 11:57
-
-
Save ajskelton/7bfd04bba378d22f9df3dafe9b5a42e1 to your computer and use it in GitHub Desktop.
Add a Text field to the WordPress Customizer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wp_customize->add_setting( 'themeslug_text_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'default' => 'Lorem Ipsum', | |
'sanitize_callback' => 'sanitize_text_field', | |
) ); | |
$wp_customize->add_control( 'themeslug_text_setting_id', array( | |
'type' => 'text', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Text' ), | |
'description' => __( 'This is a custom text box.' ), | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment