Linking each text word or words divided by comma into an existing URL?
- by Mezelderz
I am trying to auto add each word or words divided by comma into an existing url.
I have url lets say http://stackoverflow.com/search?q=HERE IS THAT TEXT.
I have this function:
function movie_cast( $atts, $content = null ) {
return '<div class="movie_cast">Cast: '.$content.'</div>';
}
add_shortcode( 'movie_cast', 'movie_cast' );
I am using it: [movie_cast]Actor 1, Actor 2[/movie_cast]
Output from this is just text: Actor 1, Actor 2
How can I get otput it like this: <a href="http://stackoverflow.com/search?q=Actor 1">Actor 1</a>, <a href="http://stackoverflow.com/search?q=Actor 2">Actor 2</a>