As part of a new project I’m working on, there is a need to have 2 types of wysiwyg field which have different toolbar buttons set up.
I’ve tried to go about this by creating a new field type for the duplicate wysiwyg field, using the documentation here: https://www.advancedcustomfields.com/resources/creating-a-new-field-type/
Then inside the render_field()
function, I tried switching the type from clone_wysiwyg
to wysiwyg
similar to how the type is reassigned in the post_object field type:
// Inside class-acf-field-post_object.php:332
function render_field( $field ) {
// Change Field into a select
$field['type'] = 'select';
// ...
}
However, the wysiwyg field doesn’t initialise in the page edit view when I use it as part of a field group.
How can I initialise the field and pass it custom TinyMCE args?