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 would like to add a button to this toolbar, right of "fullscreen":

enter image description here

The button should add this: „“

If text is selected, it should get around the text, like this: „selected text“

How can I add such a button to the ed_toolbar (class: quicktags-toolbar)?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Try adding the following code in your function.php

add_action( 'admin_footer-post-new.php', 'wpse_64665_add_quick_tag' );
add_action( 'admin_footer-post.php',     'wpse_64665_add_quick_tag' );
function wpse_64665_add_quick_tag() { ?>
    <script type="text/javascript">
        edButtons[edButtons.length] = new edButton( '„“', '„“', '„', '“', '' );
    </script><?php
}
share|improve this answer
    
Thank you, it worked fine. According to this page, I would have to give two more parameters: codex.wordpress.org/Function_Reference/add_action . Strange. –  moose Sep 10 '12 at 7:02
1  
Those are optional paramaters and are not required for this example. You could play with the priority just incase. –  Joshua Abenazer Sep 10 '12 at 7:07

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.