I recently submitted a pull request to WooCommerce core, which adds some consistency to the descriptions of textarea fields in WooCommerce settings, and the ability to set an attribute to make the description appear before or after the textarea field. This contribution has been reviewed, merged, and is scheduled for release in WooCommerce v9.6.0.
Table of Contents
Text color consistency
When you add a textarea
type WooCommerce setting field, you’ll notice the text color of the description is different from text fields:
In the above screenshot you can see how the textarea
field description is black unlike the text
type field.
For consistency, this has been amended to use the same color, and will now look like this:
Respect the desc_at_end attribute
This PR also allows the desc_at_end
attribute to be used.
Previously there wasn’t a means of showing the description after the textarea
field, now you can.
For example, when registering a textarea
WooCommerce setting, you can specify desc_at_end
to true
:
$settings[] = array(
'name' => 'Test text area',
'id' => 'test-text-area',
'type' => 'textarea',
'desc' => 'Lorem ipsum dolor sit amet.',
'desc_at_end' => true,
);
This will result in:
If you set it to false
or omit the attribute completely, it remains like this:
More info and thanks
For more info on this PR, view it on GitHub.
Thanks to Corey McKrill for reviewing the PR and approving it.