﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
10936	Ability to add custom quicktags without modifying quicktags.js	aldenta		"I've tried to figure out a way to add custom quicktags to the HTML editor to make inserting code easier for my clients but I can't seem to find a way without modifying core code.  All examples on the web also suggest editing the quicktags.js (which is compressed) but I'd prefer not to go that route.

The simplest way I found to make this possible is adding a 'quicktags' action which is in the attached patch.  Then, you can do something like the following example to create a custom quicktag.

{{{
function custom_quicktags() {
	echo '<script type=""text/javascript"" charset=""utf-8"">';
	echo ""edButtons[edButtons.length] =
		new edButton('ed_caption'
		,'caption'
		,'<p class=\""wp-caption-text\"">'
		,'</p>'
		,'caption'
		);"";
	echo '</script>';
}
add_action('quicktags', 'custom_quicktags');
}}}

It could also be enhanced to use a filter or other PHP function that utilizes the same parameters as edButton and prints a list of edButton objects before edToolbar() is called.

Right now, I only updated the patch to include general-template.php. However, press-this.php also calls wp_print_scripts( 'quicktags' ); but no quicktags are shown in the html view.

Thanks.

John"	enhancement	closed	normal		Editor		normal	worksforme	has-patch	
