Opened 14 years ago
Closed 13 years ago
#16930 closed defect (bug) (fixed)
Quicktags Javascript enqueue issue
Reported by: | instruite | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Editor | Keywords: | dev-feedback |
Focuses: | Cc: |
Description
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,
instruite
Related: #16694, #16695