quicktags “link” button doesn’t work, but all other buttons do

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.

Read More
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' );

enter image description here

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.

Related posts

1 comment

  1. Figured it out. You’ll need something like this in your custom JS:

    $('#textarea_id').on('click focusin', function() {
        wpActiveEditor = 'textarea_id';
    });
    

Comments are closed.