<?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>bbPress support forums Topic: Tags separated with commas</title>
<link>http://bbpress.org/forums/</link>
<description>bbPress support forums Topic: Tags separated with commas</description>
<language>en</language>
<pubDate>Tue, 02 Dec 2008 12:03:04 +0000</pubDate>

<item>
<title>NickBrady on "Tags separated with commas"</title>
<link>http://bbpress.org/forums/topic/tags-separated-with-commas#post-4674</link>
<pubDate>Tue, 20 Feb 2007 09:10:44 +0000</pubDate>
<dc:creator>NickBrady</dc:creator>
<guid isPermaLink="false">4674@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Hi, chrishajer&#60;/p&#62;
&#60;p&#62;In the tests we have done, it does work adding a new topic and also adding new tags to an existing topic.
&#60;/p&#62;</description>
</item>
<item>
<title>chrishajer on "Tags separated with commas"</title>
<link>http://bbpress.org/forums/topic/tags-separated-with-commas#post-4622</link>
<pubDate>Sun, 18 Feb 2007 13:38:14 +0000</pubDate>
<dc:creator>chrishajer</dc:creator>
<guid isPermaLink="false">4622@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Hi Nick.  Can you say if this works for adding a new topic and also when adding tags to an existing topic?  And also, do you have an example of where this is running?&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
</item>
<item>
<title>NickBrady on "Tags separated with commas"</title>
<link>http://bbpress.org/forums/topic/tags-separated-with-commas#post-4621</link>
<pubDate>Sun, 18 Feb 2007 13:04:03 +0000</pubDate>
<dc:creator>NickBrady</dc:creator>
<guid isPermaLink="false">4621@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I wanted to have tags separated by commas instead of spaces, to allow users to write tags with more than word.&#60;/p&#62;
&#60;p&#62;I did two very small changes to the function add_topic_tags() in the file functions.php and it works, here it goes in case someone is interested:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
function add_topic_tags( $topic_id, $tags ) {&#60;br /&#62;
	global $bbdb;&#60;/p&#62;
&#60;p&#62;	$tags = trim( $tags );&#60;br /&#62;
	$words = preg_split(&#34;/[,]+/&#34;, $tags);   // removed \s&#60;/p&#62;
&#60;p&#62;	if ( !is_array( $words ) )&#60;br /&#62;
		return false;&#60;/p&#62;
&#60;p&#62;	foreach ( $words as $tag ) :&#60;br /&#62;
		add_topic_tag( $topic_id, trim($tag) );  // added trim()&#60;br /&#62;
	endforeach;&#60;br /&#62;
	return true;&#60;br /&#62;
}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
</item>

</channel>
</rss>
