Make WordPress Core

Changeset 60662


Ignore:
Timestamp:
08/26/2025 05:47:40 PM (5 months ago)
Author:
TimothyBlynJacobs
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-control.php

    r59785 r60662  
    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 ) ) : ?>
     
    576579                <textarea
    577580                    id="<?php echo esc_attr( $input_id ); ?>"
    578                     rows="5"
    579581                    <?php echo $describedby_attr; ?>
    580582                    <?php $this->input_attrs(); ?>
Note: See TracChangeset for help on using the changeset viewer.