[wp-trac] [WordPress Trac] #33421: wp_editor with custom editor_id not working

WordPress Trac noreply at wordpress.org
Wed Aug 19 17:14:29 UTC 2015


#33421: wp_editor with custom editor_id not working
--------------------------+-----------------------------------------
 Reporter:  abadahenno    |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  TinyMCE       |     Version:  4.2.4
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:  javascript, administration
--------------------------+-----------------------------------------
Changes (by azaozz):

 * status:  new => closed
 * resolution:   => duplicate
 * milestone:  Awaiting Review =>


Comment:

 Duplicate of #26778. The `$editor_id` cannot contain square braces (or
 other characters that don't work in jQuery selectors). A warning about
 this was added in #27601 one and a half years ago.

 If you need to use square braces in the textarea name, please see the
 inline docs: https://core.trac.wordpress.org/browser/tags/4.3/src/wp-
 includes/class-wp-editor.php#L46.

 Also, it's not recommended to run the initial text through wpautop(). This
 is done automatically when needed (i.e. if another plugin hasn't disabled
 it).

 The above example would be:
 {{{
 $settings = array( 'media_buttons' => false, 'textarea_name' => 'my-
 form[myeditor]' );
 wp_editor( stripslashes( $options['message'] ), 'my-editor-id', $settings
 );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33421#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list