I’ve used a trick for quite awhile that allows me to place shortcodes in the text widgets on my site.
WordPress 2.9 was released with the ability to auto-embed media, such as youtube videos, in posts by simply pasting a plain text URL into the post content. I have thought for some time that it would be really great to be able to borrow from the idea behind the shortcode in text widget trick to enable the same auto-embed functionality in my text widgets.
With the help of a couple of my fellow StudioPress forum moderators, Charles Clarkson and Gary Jones, I now have a solution! The YouTube video in the footer of this site, for example, is placed using the
shortcode to automatically embed the video.
This trick can be acomplished by adding the following code to the functions.php file in your sites active theme directory.
This should allow both plain text urls in text widgets and thePGNvZGU+W2VtYmVkXTwvY29kZT4=
Would look like this:PGNvZGU+W2VtYmVkIHdpZHRoPSIyNTAiIGhlaWdodD0iMTY1Il1odHRwOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9eW13a1pDNV9oWThbL2VtYmVkXTwvY29kZT4=
Would look like this: