[wp-trac] [WordPress Trac] #16695: quicktags needs some refactoring
WordPress Trac
wp-trac at lists.automattic.com
Sat Sep 17 23:22:40 UTC 2011
#16695: quicktags needs some refactoring
-------------------------+------------------------
Reporter: garyc40 | Owner: azaozz
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 3.3
Component: Editor | Version: 3.1
Severity: normal | Resolution:
Keywords: needs-patch |
-------------------------+------------------------
Comment (by trepmal):
I'm having trouble getting self-closing tags to work using
`QTags.addButton` but I'm not sure if it's a bug or if I just have bad
code.
Here's what I have:
{{{
add_action( 'admin_print_footer_scripts', 'kl_footer_scripts', 20 );
function kl_footer_scripts() {
?>
<script type='text/javascript'>
QTags.addButton('peb_0', 'H4', "<h4>", "</h4>");
QTags.addButton('peb_1', 'NP', "<!--nextpage-->", "", -1);
</script>
<?php
}
}}}
The `H4` tag works fine, but `NP` won't - the button simply doesn't appear
in the toolbar.
If I remove the arg2 check in quicktags.dev.js (line 340), then the NP
button works perfectly.
I can upload a patch if needed, I'm just not sure if the problem can be
solved by making my own code better.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16695#comment:49>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list