[solved] How to make block editor dialog larger (ideally resizable)?
Permalink
The docs say that the block controller class can define $btInterfaceWidth and $btInterfaceHeight propreties to set the size of the block editor dialog.
Alas, these two properties seem completely ignored, they have absolutely no effect, and I tried setting $btInterfaceWidth to 700, "700" and "700px". No joy.
What method _will_ work?
Alas, these two properties seem completely ignored, they have absolutely no effect, and I tried setting $btInterfaceWidth to 700, "700" and "700px". No joy.
What method _will_ work?
Figured it out (by examining framework code, AAAARGHHHH!!!!): just override getBlockTypeInterfaceWidth() and getBlockTypeInterfaceHeight().
what file did you edit to update this?
I didn't modify the framework itself, I only examined its code to see where it gets the desired width and height from my own block controller class. The only change I made was to my block's controller.php. If you want larger editor for an existing block type, edit that blocktype's controller.php to add the abovementioned methods to the controller class, e.g.:
class MyBlocktypeBlockController { // ... public function getBlockTypeInterfaceWidth() { return 800; } public function getBlockTypeInterfaceHeight() { return 600; } // ... }
Or, change the properties in the class, like you did, login to the dashboard, go into add functionality, find the block in question, and click refresh.
These settings are cached in the database record for the block type. Refresh re-saves that information.
These settings are cached in the database record for the block type. Refresh re-saves that information.