Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to put a couple of quicktags/buttons on a textarea which is outputted by a plugin called user submitted posts. I have given this textarea an unique id and read this on the Quicktags documentation:

  • Run quicktags(settings) to initialize it, where settings is an object containing up to 3 properties:
  • settings = {
  • id : 'my_id', the HTML ID of the textarea, required
  • buttons: '' Comma separated list of the names of the default buttons to show. Optional.
  • Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close';
  • } *
  • The settings can also be a string quicktags_id. *
  • quicktags_id string The ID of the textarea that will be the editor canvas
  • buttons string Comma separated list of the default buttons names that will be shown in that instance.

Than, I put this in my functions.php:

<?php
add_action('admin_print_footer_scripts','my_admin_print_footer_scripts');
function my_admin_print_footer_scripts()
{
?>
<script type="text/javascript">/* <![CDATA[ */

    var id = "myID"; // this is your metabox's textarea id

    settings = {
        id : id,
        buttons: 'strong,em,link' 
    }

    quicktags(settings);

/* ]]> */</script>
<?php } ?>

The problem: nothing shows up.

PS: I already looked here: Use quicktags toolbar on any textarea

Can someone make a suggestion?

share|improve this question

2 Answers 2

it you're not seeing the buttons, try to call QTags._buttonsInit(); right after you call the quicktags( settings ); function.

quicktags(settings);
QTags._buttonsInit();

Following also works for me

qt_editor = new QTags( { 'id': 'my_editor', 'buttons': 'strong,em,link' } );
QTags._buttonsInit();

Also, it seems that adding a button via QTags.addButton() function also makes your toolbar to display

qt_editor = new QTags( { 'id': 'my_editor', 'buttons': 'strong,em,link' } );
QTags.addButton( 'my_button', 'my button', '<br />' );
share|improve this answer
up vote 0 down vote accepted

There is no possibility to make it work with a different plugin. Solution: use Javascript like here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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