0

I added an quicktag for my wordpress editor:

function generico_quicktags() {

    if ( wp_script_is( 'quicktags' ) ) {
    ?>
    <script type="text/javascript">
    QTags.addButton(
        'pov_generico', 
        'POV (Genérico)', 
        '[pov-generico]', 
        '[/pov-generico]'
    );
    QTags.addButton( 'pov_generico', 'p', '<p class="fala generico">', '</p>', '', 'Fala (Personagem Genérico)', 10 );
    </script>
    <?php
    }

}
add_action( 'admin_print_footer_scripts', 'generico_quicktags' );

But the button only show in Wordpress editor, not in bbpress's reply form. Is there a way to make the quicktag show there too?

1 Answer 1

0

SOLVED!

I just put anther add_action to insert the javascript in the rest of the theme (and for bbpress too):

add_action( 'wp_print_footer_scripts', 'generico_quicktags' );

The quicktags check in function already prevents wordpress to put the javascript in unwanted places!

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.