WordPress.org

Ready to get started?Download WordPress

Forums

remove kses filter (4 posts)

  1. webgrafia
    Member
    Posted 6 years ago #

    Is there a way to remove kses filter via plugin, without hacking code?

    I tryed
    remove_filter('content_save_pre', 'wp_filter_post_kses');

    But it's not working, and wp_filter_post_kses is still called

    I also tryed to use

    add_action('init','kses_remove_filters');

    But nothing happened.

    I need to extend allowed protocols, but the call at wp_kses (inside wp_filter_post_kses) use the original array ($allowed_protocols) that is not global, so to do that I was tryng to override the original call.

    Also a way to extend $allowed_protocols is a solution for me..

    Thanks!

  2. alpha2zee
    Member
    Posted 6 years ago #

    Try using htmLawed, a highly modified version of the kses filter with many extra features.

  3. Binh
    Member
    Posted 6 years ago #

    Me too, I also am trying to make a plugin to work. So far so bad, remove_filter does't work at all. Here is a little bragging: Can't make plugin to remove KSES filter

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    remove_filter would work, if you called it in the right place. kses is not turned on until the init filter.

    Anyway, this should work. The key is to delay it until after the init action hook enables kses.

    function disable_kses_content() {
    remove_filter('content_save_pre', 'wp_filter_post_kses');
    }
    add_action('init','disable_kses_content',20);

Topic Closed

This topic has been closed to new replies.

About this Topic