tag:blogger.com,1999:blog-3474748080814775582.post2829457324923117051..comments2021-04-20T11:20:48.148-05:00Comments on Javascript, jQuery and other Junk: Adding WordPress Quicktag Buttons to a WP PluginRob Garrisonhttp://www.blogger.com/profile/03268017297500430302noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-3474748080814775582.post-10256054663674371412012-12-07T08:24:19.296-06:002012-12-07T08:24:19.296-06:00Yay! It works! THANK YOU for this! You figured out...Yay! It works! THANK YOU for this! You figured out how to do this very simply (everything else I found seemed super complicated and didn't sit well with me). This code also works in a theme's functions.php. <br /><br />Just one thing, I'm using WP 3.4 and adding it to the admin_footer put it above the quicktags.js, so instead I added it to "admin_print_footer_scripts" with a priority of 999: <br /><br />add_action('admin_print_footer_scripts', 'my_plugin_add_button', 999);<br /><br />Then it worked. :) And as @Junelsa said, you don't need the tbar portion of the script. The button would just use whatever name you want (like the shortcode's name).<br /><br />Thanks again!Caitlinhttps://www.blogger.com/profile/06250404001012444336noreply@blogger.comtag:blogger.com,1999:blog-3474748080814775582.post-29451204950530672532012-09-03T01:38:51.479-05:002012-09-03T01:38:51.479-05:00Thanks for this. :)
For info adding the new elemen...Thanks for this. :)<br />For info adding the new elements to the "edButtons" array is sufficient for them to appear on the backend, no need to update "ed_toolbar" node.Junelsa Philippehttps://www.blogger.com/profile/13208777936409160884noreply@blogger.comtag:blogger.com,1999:blog-3474748080814775582.post-81937888422003496782011-08-31T14:36:16.531-05:002011-08-31T14:36:16.531-05:00Hiya!
I did that in case the plugin shortcode had...Hiya!<br /><br />I did that in case the plugin shortcode had any quotes inside of it, so basically that replaced any quotes with an escaped quote... maybe I did that wrong?Rob Garrisonhttps://www.blogger.com/profile/03268017297500430302noreply@blogger.comtag:blogger.com,1999:blog-3474748080814775582.post-57730090753751633052011-08-31T11:03:31.635-05:002011-08-31T11:03:31.635-05:00Thanks it was useful. The only problem n.display.r...Thanks it was useful. The only problem n.display.replace(/\"/g,'\"') looks wierdmyBloghttps://www.blogger.com/profile/16053109418228406915noreply@blogger.com