Opened 2 years ago

Closed 21 months ago

#16930 closed defect (bug) (fixed)

Quicktags Javascript enqueue issue

Reported by: instruite Owned by: azaozz
Priority: normal Milestone: 3.3
Component: Editor Version: 3.1
Severity: normal Keywords: dev-feedback
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

Change History (4)

  • Component changed from UI to Editor

Related: #16694, #16695

  • Owner set to azaozz
  • Status changed from new to reviewing
  • Milestone changed from Awaiting Review to 3.3
  • Resolution set to fixed
  • Status changed from reviewing to closed

Fixed by the changes in #9346.

Note: See TracTickets for help on using tickets.