<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: WordPress 2.5 Shortcodes</title> <atom:link href="http://xavisys.com/wordpress-25-shortcodes/feed/" rel="self" type="application/rss+xml" /><link>http://xavisys.com/wordpress-25-shortcodes/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=wordpress-25-shortcodes</link> <description>WordPress Plugins and Custom WordPress Development</description> <lastBuildDate>Thu, 11 Mar 2010 12:45:42 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: tobeetaylor (Tobias Oberrauch)</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-3853</link> <dc:creator>tobeetaylor (Tobias Oberrauch)</dc:creator> <pubDate>Fri, 15 Jan 2010 19:41:44 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-3853</guid> <description>#wordpress shortcodes http://xavisys.com/wordpress-25-shortcodes/</description> <content:encoded><![CDATA[<p>#wordpress shortcodes <a
href="http://xavisys.com/wordpress-25-shortcodes/" rel="nofollow">http://xavisys.com/wordpress-25-shortcodes/</a></p> ]]></content:encoded> </item> <item><title>By: Hammad Khalid</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-719</link> <dc:creator>Hammad Khalid</dc:creator> <pubDate>Sun, 16 Aug 2009 07:03:09 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-719</guid> <description>You are amazing! I tried every thing but did not think that could be the problem. I looked into the fetch_rss and apparently its deprecated. It replaced with the fetch_feed function which i was easily integrate into your code. Thanks again!</description> <content:encoded><![CDATA[<p>You are amazing! I tried every thing but did not think that could be the problem. I looked into the fetch_rss and apparently its deprecated. It replaced with the fetch_feed function which i was easily integrate into your code. Thanks again!</p> ]]></content:encoded> </item> <item><title>By: Aaron D. Campbell</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-722</link> <dc:creator>Aaron D. Campbell</dc:creator> <pubDate>Fri, 14 Aug 2009 19:44:02 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-722</guid> <description>The problem is that wp_rss echo&#039;s out the content rather than returning it.  What you can do is create your own custom RSS function and use it instead:
[code lang=&quot;php&quot;]
function my_wp_rss( $url, $num_items = -1 ) {
$return = &#039;&#039;;
if ( $rss = fetch_rss( $url ) ) {
$return .= &#039;&lt;ul&gt;&#039;;if ( $num_items !== -1 ) {
$rss-&gt;items = array_slice( $rss-&gt;items, 0, $num_items );
}foreach ( $rss-&gt;items as $item ) {
$return .= sprintf(
&#039;&lt;li&gt;&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; rel=&quot;nofollow&quot;&gt;%3$s&lt;/a&gt;&lt;/li&gt;&#039;,
clean_url( $item[&#039;link&#039;] ),
attribute_escape( strip_tags( $item[&#039;description&#039;] ) ),
htmlentities( $item[&#039;title&#039;] )
);
}$return .= &#039;&lt;/ul&gt;&#039;;
} else {
$return .=__( &#039;An error has occurred, which probably means the feed is down. Try again later.&#039; );
}
return $return;
}include_once(ABSPATH.WPINC.&#039;/rss.php&#039;);function readRss($atts) {
extract(shortcode_atts(array(
&quot;feed&quot; =&gt; &#039;http://&#039;,
&quot;num&quot; =&gt; &#039;1&#039;,
), $atts));return my_wp_rss($feed, $num);
}add_shortcode(&#039;rss&#039;, &#039;readRss&#039;);
[/code]And still use the shortcode like you did before:
&lt;code&gt;[rss feed=&quot;http://feeds.feedburner.com/wprecipes&quot; num=&quot;5&quot;]&lt;/code&gt;</description> <content:encoded><![CDATA[<p>The problem is that wp_rss echo&#8217;s out the content rather than returning it.  What you can do is create your own custom RSS function and use it instead:</p><pre class="brush: php;">
function my_wp_rss( $url, $num_items = -1 ) {
	$return = '';
	if ( $rss = fetch_rss( $url ) ) {
		$return .= '&lt;ul&gt;';

		if ( $num_items !== -1 ) {
			$rss-&gt;items = array_slice( $rss-&gt;items, 0, $num_items );
		}

		foreach ( $rss-&gt;items as $item ) {
			$return .= sprintf(
				'&lt;li&gt;&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; rel=&quot;nofollow&quot;&gt;%3$s&lt;/a&gt;&lt;/li&gt;',
				clean_url( $item['link'] ),
				attribute_escape( strip_tags( $item['description'] ) ),
				htmlentities( $item['title'] )
			);
		}

		$return .= '&lt;/ul&gt;';
	} else {
		$return .=__( 'An error has occurred, which probably means the feed is down. Try again later.' );
	}
	return $return;
}

include_once(ABSPATH.WPINC.'/rss.php');

function readRss($atts) {
	extract(shortcode_atts(array(
		&quot;feed&quot; =&gt; 'http://',
		&quot;num&quot; =&gt; '1',
	), $atts));

	return my_wp_rss($feed, $num);
}

add_shortcode('rss', 'readRss');
</pre><p>And still use the shortcode like you did before:<br
/> <code>[rss feed="http://feeds.feedburner.com/wprecipes" num="5"]</code></p> ]]></content:encoded> </item> <item><title>By: Hammad Khalid</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-721</link> <dc:creator>Hammad Khalid</dc:creator> <pubDate>Fri, 14 Aug 2009 19:13:15 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-721</guid> <description>Forgot to Add: Funtion;include_once(ABSPATH.WPINC.&#039;/rss.php&#039;);function readRss($atts) {
extract(shortcode_atts(array(
&quot;feed&quot; =&gt; &#039;http://&#039;,
&quot;num&quot; =&gt; &#039;1&#039;,
), $atts));return wp_rss($feed, $num);
}add_shortcode(&#039;rss&#039;, &#039;readRss&#039;);And Shortcode =
[rss feed=&quot;http://feeds.feedburner.com/wprecipes&quot; num=&quot;5&quot;]</description> <content:encoded><![CDATA[<p>Forgot to Add: Funtion;</p><p>include_once(ABSPATH.WPINC.&#8217;/rss.php&#8217;);</p><p>function readRss($atts) {<br
/> extract(shortcode_atts(array(<br
/> &#8220;feed&#8221; =&gt; &#8216;http://&#8217;,<br
/> &#8220;num&#8221; =&gt; &#8216;1&#8242;,<br
/> ), $atts));</p><p> return wp_rss($feed, $num);<br
/> }</p><p>add_shortcode(&#8216;rss&#8217;, &#8216;readRss&#8217;);</p><p>And Shortcode =<br
/> [rss feed="http://feeds.feedburner.com/wprecipes" num="5"]</p> ]]></content:encoded> </item> <item><title>By: Hammad Khalid</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-720</link> <dc:creator>Hammad Khalid</dc:creator> <pubDate>Fri, 14 Aug 2009 18:35:52 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-720</guid> <description>Hello Aaron,Your post was very helpful. I am having a little problem with shortcodes on my website though.I have [rss feed=&quot;http://feeds.digg.com/digg/popular.rss&quot;] which call a fucntion that displays feeds on to my page.The feeds are working, however they move right to the top of my content page instead. (check sosmos.com/testing). How can i fix this?Thanks!!</description> <content:encoded><![CDATA[<p>Hello Aaron,</p><p>Your post was very helpful. I am having a little problem with shortcodes on my website though.</p><p>I have [rss feed="http://feeds.digg.com/digg/popular.rss"] which call a fucntion that displays feeds on to my page.</p><p>The feeds are working, however they move right to the top of my content page instead. (check sosmos.com/testing). How can i fix this?</p><p>Thanks!!</p> ]]></content:encoded> </item> <item><title>By: Aaron D. Campbell</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-716</link> <dc:creator>Aaron D. Campbell</dc:creator> <pubDate>Fri, 03 Jul 2009 02:54:30 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-716</guid> <description>Sure, you can process shortcodes anywhere you want using the do_shortcode function.  Just pass it the text you want to process shortcodes in and it passes back the processed text:
&lt;pre&gt;
echo do_shortcode(&#039;some text with a [shortcode] to process&#039;);
&lt;/pre&gt;If you want to process comments though, just add it as a filter to the comment text like this:
&lt;pre&gt;
add_filter(&#039;comment_text&#039;, &#039;do_shortcode&#039;);
&lt;/pre&gt;You may want to give it a high priority (high number means it runs later) so that it runs AFTER wpautop runs like this:
&lt;pre&gt;
add_filter(&#039;comment_text&#039;, &#039;do_shortcode&#039;, 35);
&lt;/pre&gt;You should be able to put either of those into your theme&#039;s functions.php file or run it on init from a plugin.</description> <content:encoded><![CDATA[<p>Sure, you can process shortcodes anywhere you want using the do_shortcode function.  Just pass it the text you want to process shortcodes in and it passes back the processed text:</p><pre>
echo do_shortcode('some text with a [shortcode] to process');
</pre><p>If you want to process comments though, just add it as a filter to the comment text like this:</p><pre>
add_filter('comment_text', 'do_shortcode');
</pre><p>You may want to give it a high priority (high number means it runs later) so that it runs AFTER wpautop runs like this:</p><pre>
add_filter('comment_text', 'do_shortcode', 35);
</pre><p>You should be able to put either of those into your theme&#8217;s functions.php file or run it on init from a plugin.</p> ]]></content:encoded> </item> <item><title>By: Brucem</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-715</link> <dc:creator>Brucem</dc:creator> <pubDate>Fri, 03 Jul 2009 00:47:56 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-715</guid> <description>It appears that shortcodes are not parsed in rendering comments. Is that correct? Is there a way to enable that? The reason (specific example) is that I wanted to use WikiPop in a reply to another comment.I see that there could be security risks with this, but I&#039;m just making sure.Thx.</description> <content:encoded><![CDATA[<p>It appears that shortcodes are not parsed in rendering comments. Is that correct? Is there a way to enable that? The reason (specific example) is that I wanted to use WikiPop in a reply to another comment.</p><p>I see that there could be security risks with this, but I&#8217;m just making sure.</p><p>Thx.</p> ]]></content:encoded> </item> <item><title>By: Mastering WordPress Shortcodes &#124; Bookmarks</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-714</link> <dc:creator>Mastering WordPress Shortcodes &#124; Bookmarks</dc:creator> <pubDate>Mon, 20 Apr 2009 20:09:14 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-714</guid> <description>[...] WordPress 2.5 shortcodes Excellent shortcodes tutorial. [...]</description> <content:encoded><![CDATA[<p>[...] WordPress 2.5 shortcodes Excellent shortcodes tutorial. [...]</p> ]]></content:encoded> </item> <item><title>By: Navjot Singh</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-705</link> <dc:creator>Navjot Singh</dc:creator> <pubDate>Fri, 20 Mar 2009 11:05:02 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-705</guid> <description>I have a shortcode which does not accept content, infact it works like this:  [shortcode id=&quot;value&quot;]Any idea how to make meta box work correctly in such case? I tried but it sends [shortcode [id=&quot;value&quot;] which is incorrect.</description> <content:encoded><![CDATA[<p>I have a shortcode which does not accept content, infact it works like this:  [shortcode id=&quot;value&quot;]</p><p>Any idea how to make meta box work correctly in such case? I tried but it sends [shortcode [id=&quot;value&quot;] which is incorrect.</p> ]]></content:encoded> </item> <item><title>By: 5 Tutorials um WordPress ShortCodes zu verstehen</title><link>http://xavisys.com/wordpress-25-shortcodes/#comment-701</link> <dc:creator>5 Tutorials um WordPress ShortCodes zu verstehen</dc:creator> <pubDate>Fri, 13 Mar 2009 16:56:34 +0000</pubDate> <guid
isPermaLink="false">http://xavisys.com/?p=84#comment-701</guid> <description>[...] WordPress 2.5 Shortcodes Erkl&#228;rt sehr umfangreich die Entwicklung eines gro&#223;en Plugins. [...]</description> <content:encoded><![CDATA[<p>[...] WordPress 2.5 Shortcodes Erkl&#228;rt sehr umfangreich die Entwicklung eines gro&#223;en Plugins. [...]</p> ]]></content:encoded> </item> </channel> </rss>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching using apc
Content Delivery Network via cdn.xavisys.com

Served from: 173.203.136.116 @ 2010-03-12 13:24:52 -->