Ideas

Add a filter before strip_tags()

  1. IKEDA Yuriko
    Member

    I suggest 'strip_tags' filter before all strip_tags() function.

    $after = strip_tags(apply_filters('strip_tags', $before, $context) );

    In wp-includes/*.php, many code uses PHP's strip_tags() function. Most cases are fine, but the html using "del" elements meets a bad situation:

    (before) I left home <del>one hour</del><ins>two hours</ins> before.
    (after) I left home one hourtwo hours before.

    The favorable result is removing del elements with inside text like below:

    (favorable) I left home two hours before.

    In current WordPress code, it is little hard to creating a plugin that realize this behavior.
    If there is a filter like above, we can write the plugin in easy way.

    Posted: 3 years ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    8 Votes
  • Status

    Sorry, not right now