Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#16930 closed defect (bug) (fixed)

Quicktags Javascript enqueue issue

Reported by: instruite's profile instruite Owned by: azaozz's profile 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

Change History (4)

#1 @garyc40
14 years ago

  • Component changed from UI to Editor

Related: #16694, #16695

#2 @ocean90
13 years ago

  • Owner set to azaozz
  • Status changed from new to reviewing

#3 @ocean90
13 years ago

  • Milestone changed from Awaiting Review to 3.3

#4 @azaozz
13 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

Fixed by the changes in #9346.

Note: See TracTickets for help on using tickets.