Reply To: @mention autosuggest in visual editor
@oliver_rub, our current solution involves deregistering the BuddyPress mentions script and enqueuing our own slightly modified version with a more generic jQuery selector. I think @slaffik has found the best solution though, I’m going to try it.
@benworxnl, no we had a slightly different scenario. We transformed the “What’s New” textarea into a WYSIWYG editor and the visual tab worked on that straight away. The issue we had was getting the mentions to work on that visual editor.
Anyway, we duplicated and edited the activity/post-form.php template and replaced the textarea with wp_editor;
wp_editor( isset( $_GET['r'] ) ? '@' . esc_attr( $_GET['r'] ) : '', 'whats-new', array( 'textarea_name' => 'whats-new', 'editor_class' => 'whats-new-mce', 'editor_height' => 200, 'tinymce' => array( 'toolbar1' => 'bold,italic,underline,|,blockquote,|,bullist,numlist,|,link,unlink,|,spellchecker,|,undo,redo', 'toolbar2' => '' ) ) );
For activity replies, you could do something similar to this in activity/entry.php;
wp_editor( isset( $_GET['r'] ) ? '@' . esc_attr( $_GET['r'] ) : '', 'ac-input-' . bp_activity_id(), array( 'textarea_name' => 'ac_input_' . bp_activity_id(), 'editor_class' => 'ac-input', 'editor_height' => 200, 'tinymce' => array( 'toolbar1' => 'bold,italic,underline,|,blockquote,|,bullist,numlist,|,link,unlink,|,spellchecker,|,undo,redo', 'toolbar2' => '' ) ) );
Please note, I’ve not tested the above.