package MT::Plugin::tag_glue; use strict; use vars qw( $VERSION ); $VERSION = '0.2'; use MT::Plugin (); use MT::Template::Context (); MT->add_plugin( MT::Plugin->new( { name => "tag_glue $VERSION", description => 'Plugin to glue together values in a tag with a specified character', doc_link => 'http://prwdot.org/docs/tag_glue.html' } ) ); MT::Template::Context->add_global_filter( 'tag_glue', \&tag_glue ); sub tag_glue { my ( $string, $glue, $context ) = @_; my @values = split( /[\s]+/, $string ); my $glued_string = join( $glue, @values ); return ($glued_string); }