Skip to:
Content
Pages
Categories
Search
Top
Bottom

html code for text colour not sending in tinymce editor

  • @enkoes

    Participant

    Hi, I enable both full visual and text editors in my forum using bbp Style Pack. I found that the colour picker for text doesn’t work for every post I tested.

    To better describe the issue, pls see screenshots below:

    Before submission:
    Screenshot-1
    Screenshot-2

    After submission:
    Screenshot-3

    It seems that the html code for text colour is not sent after submission.

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • @enkoes

    Participant

    Hi all, I have done plugin conflicting test on my site but couldn’t find the cause of the issue. Can anyone help to solve it or guide me on this?

    Regards.

    @houd

    Participant

    You need to pick the allowed html tags that the users can use in your “functions.php”, like so:

    function wp_bbpress_allow_tags(){
        return array(
            'span'=> array(
                'class'     => true,
                'style'     => true,
            ),
    	// add other tags to allow here
        );
    }
    add_filter('bbp_kses_allowed_tags', 'wp_bbpress_allow_tags');

    Keep in mind the tags you pick here are the only tags that will be allowed, so list all of them here.

  • Don’t ask me why the default allowed tags are different than the default shown TinyMCE buttons.

@enkoes

Participant

@houd, thanks for your help.

I tried your code but the ‘span’ tag does not work as expected.
Strangely, I think the code itself is correct because ‘strong’ tag (bold text) does work when I added it in the code for testing purpose. Like this:

function wp_bbpress_allow_tags(){
    return array(
        'span'=> array(
            'class'     => true,
            'style'     => true,
        ),
        'strong'     => array(),
    );
}
add_filter('bbp_kses_allowed_tags', 'wp_bbpress_allow_tags');

Don’t know what go wrong.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar