[wp-trac] [WordPress Trac] #17144: Editor API enhancement

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 20 00:45:38 UTC 2011


#17144: Editor API enhancement
-------------------------+------------------
 Reporter:  azaozz       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.3
Component:  Editor       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by trepmal):

 Here's my (reduced) plugin:

 {{{

 add_action('admin_menu', function () {
         add_menu_page('wp_editor', 'wp_editor', 'read', 'wp_editor',
 function () {
                 echo '<div class="wrap"><h2>wp_editor()</h2>';

                 $content = '';
                 $id = 'editor-test';

                 $settings = array(
                         'quicktags' => array(
                                 'buttons' => 'em', // quicktags.dev.js:573
 Uncaught TypeError: Cannot read property 'callback' of undefined
                         ),
                         //'tinymce' => false
                 );

                 wp_editor($content, $id, $settings);

                 echo '</div>';

         });
 });
 }}}

 I can customize the available quicktags, but if I don't include 'close'
 {{{
 ...
 'buttons' => 'em,close'
 ...
 }}}
 I get a javascript error when I try to switch back to Visual mode.

 I don't have the JS skills to write an awesome patch, so I have a really
 small patch that could probably be done better.

 Alternatively, I have a patch for the WP_Editor class that simply forces
 'close' to always be present in the quicktags when tinymce is true.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17144#comment:67>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list