1

I am developing a widget plugin and want to add a textarea with WYSIWYG editor in widget settings.

Any help would be highly appreciated.

Thanks.

1

2 Answers 2

1

Embedding WYSIWYG Editor in Custom widget needs the declaration of the fields under a form function, this will create a WYSIWYG Editor in your widget. You can define your parameter, what all features you want to show.

public function form( $instance ) {

    $rand    = rand( 0, 999 );
    $ed_id   = $this->get_field_id( 'wp_editor_' . $rand );
    $ed_name = $this->get_field_name( 'wp_editor_' . $rand );
    $content   = 'Hello World!';
    $editor_id = $ed_id;
    $settings = array('media_buttons' => true,'textarea_rows' => 4,'textarea_name' => $ed_name,'teeny' => true,);
    wp_editor( $content, $editor_id, $settings );
-1

You can try plugins like this:

https://wordpress.org/plugins/wp-editor-widget/screenshots/
https://wordpress.org/plugins/black-studio-tinymce-widget/screenshots/

This plugins works all widgets

2
  • You did not understand my words. I meant to say, how can I implement Visual Editor in a custom widget?
    – bakar
    Commented Sep 27, 2014 at 9:52
  • 1
    Recommendations and links aren't answers, answers need to be self contained
    – Tom J Nowell
    Commented Sep 27, 2020 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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