WordPress.org

Ready to get started?Download WordPress

Forums

Post Editor Buttons Fork
[resolved] Can add span buttons, but not spoiler one... (3 posts)

  1. midori
    Member
    Posted 2 years ago #

    Hello,

    I can create <span style='whatever'> buttons, but NOT <spoiler>. To be precise, when I create it, by dutifully filling caption spoiler, before <spoiler> and after </spoiler>, as soon as I save, it only keeps the Caption and empties the two others. The button appears with the right name but does nothing.

    http://wordpress.org/extend/plugins/post-editor-buttons-fork/

  2. Kailey (trepmal)
    Volunteer Mod & Reviewer
    Plugin Author

    Posted 2 years ago #

    You can allow the spoiler tag, add this to the plugin, or to the functions.php file in your theme.
    add_filter( 'admin_init', 'allowed_tags' );
    function allowed_tags() {
    global $allowedposttags;
    $allowedposttags['spoiler'] = array();
    }

    If you need to add classes or ids to the spoiler tag, do this

    add_filter( 'admin_init', 'allowed_tags' );
    function allowed_tags() {
    global $allowedposttags;
    $allowedposttags['spoiler']['class'] = array();
    $allowedposttags['spoiler']['id'] = array();
    }

  3. midori
    Member
    Posted 2 years ago #

    Oh, perfect. That was very quick AND working. Thank you very very much!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic