WordPress.org

Ready to get started?Download WordPress

Forums

strip_tags doesn't strip in-post <style> sections (1 post)

  1. jfriedl
    Member
    Posted 7 years ago #

    I added the following to wp_trim_excerpt, just before the call to strip_tags()

    $text = preg_replace("'<style[^>]*>.*</style>'siU",'',$text);

    so that CSS doesn't make it into my post excerpts. It would be nice if strip_tags() did this, but lacking that, something like this should be added wherever strip_tags is called.....

Topic Closed

This topic has been closed to new replies.

About this Topic