snipt

Ctrl+h for KB shortcuts

PHP

Enable all HTML Tags in Profile Bios

1
2
3
4
//disable WordPress sanitization to allow more than just $allowedtags from /wp-includes/kses.php
remove_filter('pre_user_description', 'wp_filter_kses');
//add sanitization for WordPress posts
add_filter( 'pre_user_description', 'wp_filter_post_kses');
https://snipt.net/embed/03099d6aaa94d07f656572b26361c4e1/
/raw/03099d6aaa94d07f656572b26361c4e1/
03099d6aaa94d07f656572b26361c4e1
php
PHP
4
2019-06-17T04:32:03
True
False
False
Sep 10, 2012 at 01:41 PM
/api/public/snipt/46967/
enable-all-html-tags-in-profile-bios
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">//disable WordPress sanitization to allow more than just $allowedtags from /wp-includes/kses.php</span> </span><span id="L-2"><a name="L-2"></a><span class="x">remove_filter(&#39;pre_user_description&#39;, &#39;wp_filter_kses&#39;);</span> </span><span id="L-3"><a name="L-3"></a><span class="x">//add sanitization for WordPress posts</span> </span><span id="L-4"><a name="L-4"></a><span class="x">add_filter( &#39;pre_user_description&#39;, &#39;wp_filter_post_kses&#39;);</span> </span></pre></div> </td></tr></table>
"enable HTML in bio", HTML, bio, filter, wordpress