OK, first of all please note that it is not possible to generate tags from hashtags used in comments and add them to the post which the comment belongs to. This is because hashtagger adds the tags to the actual object and it is not possible to add tags to comments. So it would be necessary to first search the post where the comment belongs to and add the tags to this. This functionality is not provided by hashtagger yet. Maybe in a future version, but I’m not sure if it makes sense a visitor can add tags to a post by commenting it…
The do_hashtagger() function only adds the links to existing tags. If the tag is nout found the #hashtag stays untouched without a link generated. If this is enough for you it can be used. Otherwise I’m sorry, this can’t be solved using hashtagger.
Add this code to your functions.php to get it work:
function my_hashtag_it( $content ) {
return do_hashtagger( $content );
}
add_filter( 'comment_text', 'my_hashtag_it', 99 );
Regards
Peter
Thread Starter
BradyR
(@bradyr)
Thank you Peter! Sorry for the late reply. Hashtagger is working wonderfully for me. I should have been more specific about why I wanted to use the function in the comments section. I actually wanted people to be able to use the @username function, but not the #Hashtag function. I am not sure if this is available yet, or going to be, but I am more interested in using @username in comments and being able to click it. The reason for this is so that my users can comment on a post and mention another user in their comment. Ex: @username You would really like this! This does bring up another topic though, and that is being able to integrate the @mentions into my notification system. I would also need a way to tell @user that someone has mentioned their name in a post/comment. Thank you again for the plugin and the help.
-Brady
Hi Brady,
the code I postet should make @usernames in comments clickable (but also hashtags). But if you want to use it on your frontend than also on typing a check if the name exists would be recommendable. Like e.g. on facebook. And the mail notification is a second thing…
That’s more a social network functionality than a blogging functionality. As yet I think this will never be possible with hashtagger because your requirements are too specific and the development effort would be to huge for a free plugin.
… but who knows?
Regards
Peter