KSES Allow Twitter Widget Embed

$allowedposttags["script"] = array();
$allowedposttags['a']['data-widget-id'] = true;

The two little lines above keep the Twitter tag search widget embed code (below) from getting cleansed in the WordPress Editor.

            <a class="twitter-timeline"  href="https://twitter.com/search?q=%23vcusocy%20OR%20%23digisoc%20OR%20%23digitaldata%20OR%20%23socydigitaldata" data-widget-id="832281528470216705">Tweets about #vcusocy OR #digisoc OR #digitaldata OR #socydigitaldata</a>
            <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
          

Keeping a chunk of these extra-curricular allowed elements in a plugin allows us to activate them on a per trusted user basis.

Comments on this post

No comments.

Leave a Reply

Trackbacks and Pingbacks on this post

No trackbacks.

TrackBack URL