[wp-trac] [WordPress Trac] #16930: Quicktags Javascript enqueue issue

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 22 11:14:09 UTC 2011


#16930: Quicktags Javascript  enqueue issue
--------------------------+-----------------------------
 Reporter:  instruite     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  UI            |    Version:  3.1
 Severity:  normal        |   Keywords:  dev-feedback
--------------------------+-----------------------------
 To add new/custom buttons to Post editor toolbar, I was using
 {{{
 edButtons[edButtons.length] = new edButton('ed_custom' ,'Custom'
 ,'[custom]' ,'[/custom]' ,'x' );
 }}}
 Till Wp 2.9.2 adding the above script worked as expected.
 But with 3.1 its not working (have not checked with 3.0 series)
 after going through the wordpress files
 I found the call to add quicktags in 2 files
 ''/wp-admin/admin-header.php''
 {{{
 if ( in_array( $pagenow, array('post.php', 'post-new.php') ) ) {
         add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
         add_action( 'admin_print_footer_scripts',
 'wp_tiny_mce_preload_dialogs', 30 );
         wp_enqueue_script('quicktags');
 }
 }}}
 and ''/wp-includes/general-template.php''
 {{{
 <div id="quicktags"><?php
         wp_print_scripts( 'quicktags' );?>
         <script type="text/javascript">edToolbar()</script>
 </div>
 }}}
 And in 3.1 its not adding the script with
 ''wp_enqueue_script('quicktags');'' call
 even tried adding it in my plugin
 But adding ''wp_print_scripts( 'quicktags' );'' in place of
 ''wp_enqueue_script('quicktags');'' works
 (works by replacing it in admin-header.php directly or even through plugin
 too)
 Not sure which changes from 2.9.2 to 3.1 are affecting the
 ''wp_enqueue_script('quicktags');'' not to work in admin-header.php

 Thanks,[[BR]]
 instruite

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16930>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list