Very useful addition! I modified it slightly to be able to throw out any special characters that exist in the tags and to be able to handle any special characters that exist in the title as well. I also added an extra line between the title, url, and tags. Here is what I ended up with:
$tags = get_the_tags($ID);
$tagged = '';
if ( $tags ) {
foreach ( $tags as $tag ) { $tagged[] = rawurlencode(preg_replace('/[^A-Za-z0-9\-]/', '', htmlspecialchars_decode($tag->name))); }
$tagged = implode(' #',$tagged);
}
$caption = htmlspecialchars_decode(get_the_title($ID))."\n\n".home_url('?p='.$ID)."\n\n#".$tagged; // caption
-
This reply was modified 7 years, 7 months ago by jwenz723.