1

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

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.

  • Hi, Andrew! Did you ever figure this out? I'm having the exact same problem? – rinogo Feb 7 '14 at 16:56
0

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.