Tags separated with commas
-
Hi,
I wanted to have tags separated by commas instead of spaces, to allow users to write tags with more than word.
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:
function add_topic_tags( $topic_id, $tags ) {
global $bbdb;
$tags = trim( $tags );
$words = preg_split(“/[,]+/”, $tags); // removed s
if ( !is_array( $words ) )
return false;
foreach ( $words as $tag ) :
add_topic_tag( $topic_id, trim($tag) ); // added trim()
endforeach;
return true;
}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.