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.

Built from https://develop.svn.wordpress.org/trunk@60662


git-svn-id: http://core.svn.wordpress.org/trunk@59998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
TimothyBlynJacobs
2025-08-26 17:49:29 +00:00
parent 1448dc5aa8
commit 8bd447bc3f
2 changed files with 4 additions and 2 deletions

View File

@@ -566,6 +566,9 @@ class WP_Customize_Control {
<?php
break;
case 'textarea':
if ( !array_key_exists( 'rows', $this->input_attrs ) ) {
$this->input_attrs['rows'] = 5;
}
?>
<?php if ( ! empty( $this->label ) ) : ?>
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
@@ -575,7 +578,6 @@ class WP_Customize_Control {
<?php endif; ?>
<textarea
id="<?php echo esc_attr( $input_id ); ?>"
rows="5"
<?php echo $describedby_attr; ?>
<?php $this->input_attrs(); ?>
<?php $this->link(); ?>

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-alpha-60661';
$wp_version = '6.9-alpha-60662';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.