A multi-line text input for longer plain-text values.
Overview
The Textarea field renders a resizable multi-line text input and returns a plain string including any line breaks the user enters. Use it for longer content such as descriptions, custom messages, footer text, copyright notices, about blurbs, or any other setting that may span multiple lines.
For single-line text use the Text field. For content that should preserve HTML markup use the Raw field.
Field Registration
[
'id' => 'footer_text',
'type' => 'textarea',
'title' => __( 'Footer Text', 'your-textdomain' ),
'subtitle' => __( 'Shown in the footer area of every page', 'your-textdomain' ),
'default' => __( '© 2026 My Theme. All rights reserved.', 'your-textdomain' ),
'placeholder' => __( 'Enter footer text…', 'your-textdomain' ),
'rows' => 4,
]Field Options
| Option | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique field identifier — used as the option key |
type | string | ✅ | Must be textarea |
title | string | ✅ | Label shown above the field |
subtitle | string | — | Descriptive text shown below the label |
desc | string | — | Alternative to subtitle — shown in the same position |
placeholder | string | — | Placeholder text shown inside the input when empty |
rows | int | — | Number of visible text rows. Default: 4 |
default | string | — | Default value returned when nothing has been saved yet |
required | array | — | Conditional logic rules — see Conditional Logic |
subtitleanddescserve the same purpose and render in the same position below the label. If both are provided,subtitletakes priority.
Return Value
Type: string
Returns the text entered by the user, preserving any line breaks, or the default value if nothing has been saved yet. Returns an empty string '' if no default is set and nothing has been saved.
$footer_text = themeplus_get_option( 'footer_text', '' );
// Returns: '© 2026 My Theme. All rights reserved.'Usage Examples
Basic plain text output
$footer_text = themeplus_get_option( 'footer_text', '' );
if ( $footer_text ) {
echo '<p class="footer-text">' . esc_html( $footer_text ) . '</p>';
}Preserving line breaks as paragraph tags
$description = themeplus_get_option( 'about_description', '' );
if ( $description ) {
echo '<div class="about-text">';
echo wp_kses_post( wpautop( esc_html( $description ) ) );
echo '</div>';
}Preserving line breaks as <br> tags
$message = themeplus_get_option( 'contact_message', '' );
if ( $message ) {
echo '<p class="contact-message">' . nl2br( esc_html( $message ) ) . '</p>';
}Custom copyright notice with dynamic year
$copyright = themeplus_get_option( 'copyright_text', '' );
if ( $copyright ) {
// Replace {year} placeholder with the current year
$copyright = str_replace( '{year}', gmdate( 'Y' ), $copyright );
echo '<div class="copyright">' . esc_html( $copyright ) . '</div>';
}With a conditional field
[
'id' => 'show_custom_404',
'type' => 'toggle',
'title' => __( 'Custom 404 Message', 'your-textdomain' ),
'default' => false,
],
[
'id' => 'custom_404_text',
'type' => 'textarea',
'title' => __( '404 Message Text', 'your-textdomain' ),
'placeholder' => __( 'Sorry, the page you are looking for could not be found.', 'your-textdomain' ),
'rows' => 4,
'required' => ['show_custom_404', '==', true],
],