<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Topic: widget_text do_shortcode (how to move widget action to functions.php)?</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Wed, 19 Jun 2013 17:44:35 +0000</pubDate>

<item>
<title>acts7 on "widget_text do_shortcode (how to move widget action to functions.php)?"</title>
<link>http://themeshaper.com/forums/topic/widget_text-do_shortcode-how-to-move-widget-action-to-functionsphp#post-17014</link>
<pubDate>Mon, 15 Nov 2010 22:47:52 +0000</pubDate>
<dc:creator>acts7</dc:creator>
<guid isPermaLink="false">17014@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;This is related to Viper Video QuickTag but its a general question of conversion related to WordPress and Thematic.&#60;br /&#62;
This is the code that is called in the plugin.&#60;br /&#62;
[code]&#60;br /&#62;
add_filter( 'widget_text', 'do_shortcode', 11 ); // Videos in the text widget&#60;br /&#62;
add_action( 'widget_text', array(&#38;#38;$this, 'SWFObjectCalls'), 50 );&#60;br /&#62;
[/code]&#60;br /&#62;
The SWFObjectCalls function is what writes out the swfobject.embedswf code.&#60;br /&#62;
I’m having issue in that I don’t get the swfobject.embedSWF script unless I add an empty text widget.&#60;br /&#62;
I am almost certain this is due to the “widget_text” filter used to do the shortcode.&#60;/p&#62;
&#60;p&#62;How can I activate the do_shortcode in the sidebar without using a widget?&#60;br /&#62;
And instead activate it from my functions.php file?&#60;/p&#62;
&#60;p&#62;[code]&#60;br /&#62;
//      ... before this is my query to get post with category &#34;video&#34; ...&#60;br /&#62;
//	GET CUSTOM FIELD VALUE&#60;br /&#62;
$videoshortcode = get_post_custom_values($key = 'VideoShortcode');&#60;br /&#62;
//	GET FIRST in array in case more than one exist&#60;br /&#62;
$videoshort = $videoshortcode[0];&#60;br /&#62;
//	CHECK THAT SHORTCODE EXISTS&#60;br /&#62;
if(isset($videoshort) &#38;#38;&#38;#38; strcmp($videoshort,'')!= 0)  {&#60;/p&#62;
&#60;p&#62;	//	DO THE SHORTCODE&#60;br /&#62;
	echo do_shortcode($videoshort);&#60;br /&#62;
}&#60;br /&#62;
[/code]
&#60;/p&#62;</description>
</item>

</channel>
</rss>
