Change Wysiwyg height
-
Hi,
I’ve run into an issue with the ACF WYSIWYG field height that I believe should be reconsidered.
By default, the WYSIWYG height is set to 300px, which is perfectly reasonable as a default. The problem is that while ACF provides mechanisms to override this value (such as
acf_update_user_setting()and various field filters), the source code ultimately enforces a minimum height through:$height = max($height, 300);This means developers can increase the height, but can never reduce it below 300px.
I genuinely don’t understand the purpose of this limitation. If a developer is knowledgeable enough to use ACF filters and user settings to customize editor behavior, they’re certainly capable of choosing an appropriate height for their project.
This restriction has been frustrating developers for many years. While researching the issue, I found discussions dating back to 2016 where people were already trying to work around this limitation. The available solutions are all hacks of varying quality:
- JavaScript overrides (which can be unreliable with delayed TinyMCE initialization, repeaters, AJAX-loaded fields, etc.)
- Output buffering and string replacement
- CSS workarounds
- Other fragile approaches that shouldn’t be necessary
In many projects, especially when editing content on smaller screens or laptops, a 300px editor can be unnecessarily large and consume a significant amount of vertical space. There are valid use cases for much smaller editors, such as short descriptions, button text with formatting, teasers, notices, and similar content.
Would you consider removing the minimum-height restriction entirely, or at least making it filterable?
Removing the
max()call would not introduce any breaking changes for existing sites because the default would remain 300px. It would simply allow developers who explicitly opt into customization to choose a smaller height when appropriate.Thank you for considering it.
You must be logged in to reply to this topic.