I’ve added quicktags to a plain ol’ textarea field which sits inside a metabox on a custom post type page.
I can see the link
button on the toolbar, along with the rest of the buttons, but when clicked, the link button does nothing. Using WP 3.6. All the other buttons work except the link button, and there’s no errors in the firebug console. Have also tried with chrome.
function my_admin_print_footer_scripts() { ?>
<script type="text/javascript">/* <![CDATA[ */
var id = "textarea_id"; // textarea's id
settings = {
id : id,
buttons: 'strong,em,link,ul,ol,li,code' // have tried with default settings
}
quicktags(settings);
/* ]]> */</script>
<?php }
add_action( 'admin_print_footer_scripts', 'my_admin_print_footer_scripts' );
Is there another bit of code I need to write or another JS file to enqueue? I presume the link button must popup a box for the user to enter the link.
Figured it out. You’ll need something like this in your custom JS: