2

For editing a comment in admin pages the editor is only html, can we modify the edit comment page with a filter to include visual editor too?

  • I actually started another question while messing around with this and trying to do a similar task to what you want. The closest answer that I've gotten is there, except you'd replace the $settings['quicktags'] = false; to $settings['tinymce'] = true; instead to get the visual editor on the Edit Comments admin page: wordpress.stackexchange.com/questions/168391/… I didn't want to put it as an answer and take credit for code that doublesharp wrote. I just edited that one line for your question. – RachieVee Nov 14 '14 at 15:32
2

If you are using WordPress 4.0+ you can do this using the wp_editor_settings and the global $pagenow to determine if you are on the comments page.

add_filter( 'wp_editor_settings', 'remove_editor_quicktags', 10, 2 );
function remove_editor_quicktags( $settings, $id ){
    global $pagenow; 
    if ( $id == 'content' && $pagenow === 'comment.php' ){
        $settings['quicktags'] = false;
        $settings['tinymce'] = true;
    }
    return $settings;
}
  • Might want to change 'edit-comments.php' to 'comment.php'. That's what worked for me on the Edit Comment admin page. – RachieVee Nov 14 '14 at 20:25
  • good call, i lazily grabbed the comment listing page. didn't actually run the above code, just free formed it :) – doublesharp Nov 14 '14 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.