• [ Moderator note: moved to Fixing WordPress. Please do not use Developing With WordPress for these topics. ]

    The latest change to widgets messes up my widgets if I edit them, It used to leave my code alone but now it doesn’t.

    Also shortcodes get <p> tags inserted if there is a double line space, I am using a function to inject some HTML but if I have a blank line in my HTML there will be a <p> tag inserted and this ruins javascript among other unexpected things.

    Quite annoying, need a function to disable the WYSIWYG editor in widgets, I’d add it to all my sites.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Not a real fix, but at least a workaround:
    add the following code to your theme functions:

    remove_filter('widget_text_content', 'wpautop');
    remove_filter('widget_text_content', 'wptexturize');
    remove_filter('widget_text_content', 'capital_P_dangit');
    remove_filter('widget_text_content', 'convert_smilies');
    

    this will give you the old behaviour.

    Source:

    Addition of TinyMCE to the Text Widget

    Thread Starter dfterry

    (@dfterry)

    Thanks, I hope it works because I have a lot of websites that rely on the HTML being left alone in widgets.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress 4.8 widget autoformat messes up things’ is closed to new replies.