Skip to content

Commit b020981

Browse files
Customize: Allow specifying the number of rows for <textarea> inputs.
Previously, the textarea control was forced to use 5 rows. This commit instead applies a default value of 5, but allows for a developer to specify a different number of rows using the input_attrs arg. Props sirlouen, timhavinga, celloexpressions, sainathpoojary. Fixes #47445. git-svn-id: https://develop.svn.wordpress.org/trunk@60662 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9bc4e2f commit b020981

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wp-includes/class-wp-customize-control.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ protected function render_content() {
566566
<?php
567567
break;
568568
case 'textarea':
569+
if ( !array_key_exists( 'rows', $this->input_attrs ) ) {
570+
$this->input_attrs['rows'] = 5;
571+
}
569572
?>
570573
<?php if ( ! empty( $this->label ) ) : ?>
571574
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
@@ -575,7 +578,6 @@ protected function render_content() {
575578
<?php endif; ?>
576579
<textarea
577580
id="<?php echo esc_attr( $input_id ); ?>"
578-
rows="5"
579581
<?php echo $describedby_attr; ?>
580582
<?php $this->input_attrs(); ?>
581583
<?php $this->link(); ?>

0 commit comments

Comments
 (0)