For some reason, the WP Editor ignores some passed parameters in this case. For instance:
add_filter( 'bp_docs_wp_editor_args', 'filter_wp_editor_for_bp_docs' );
function filter_wp_editor_for_bp_docs( $settings ) {
$settings['tinymce'] = 0;
$settings['teeny'] = 1;
$settings['textarea_rows'] = 4;
return $settings;
}
The “rows” setting is respected, but not the TinyMCE prevention. I’m not sure why, actually. So, in theory it should be possible to disable TinyMCE, but it looks like it is not that simple.
Hi David
Your code almost works for me – I’ve changed it slightly and it now works perfectly:
$settings['tinymce'] = false;
$settings['textarea_rows'] = 4;
$settings['quicktags'] = false;
Cheers
Simon
Well that’s interesting. So the magic combination is setting quicktags AND tinymce to false or 0. I didn’t know what Quicktags are, so would never have tried to disable that option. https://developer.ww.wp.xz.cn/apis/handbook/quicktags/
In the end, the minimum required code to force the Docs editor’s instance of WP Editor to be a textarea is:
add_filter( 'bp_docs_wp_editor_args', 'force_bp_docs_editor_pane_to_be_textarea_only' );
function force_bp_docs_editor_pane_to_be_textarea_only( $settings ) {
$settings['tinymce'] = false;
$settings['quicktags'] = false;
return $settings;
}
Thanks for sharing!