New Plugin: Activity Stream #Hashtags
Same fundamentals as the atmention auto-link – this will catch a #hashtags and convert them into a link. The link will load the same activity-loop index template but modifies the querystring to include the search_term args. (so other activity ajax filtering works in conjunction )
Warning – links are converted prior to database saving – so if you wanted to disable the plugin the links will live on. (and probably to a 404). Sorry – this was the easy and best way to utilize the search_terms and built-in has_activities loop – since the sql within the ::get uses %%term%% – the ending delimiter is the closing a href tag. (exactly how mentions work in the activity-loop). Think I wrote 3 lines of code and just reused the rest – very simple.
You can include blog excerpts for posts and comments which are saved to the activity stream but you’ll need to add the following filters (functions or bp-custom will do)
add_filter( ‘bp_blogs_activity_new_post_content’, ‘bp_activity_hashtags_filter’ );
add_filter( ‘bp_blogs_activity_new_comment_content’, ‘bp_activity_hashtags_filter’ );
You may also change up the slug, just define BP_ACTIVITY_HASHTAGS_SLUG (default is: tag – so mydomain/bp-activity-slug/hashtags-slug/hashtag (remember the above statement about pre_ db content so it may break older links)
This the pattern that hits
/[#]([_0-9a-zA-Z-]+)/ (then double checks again for (^|s|b)#myactualhashtag )
- The topic ‘New Plugin: Activity Stream #Hashtags’ is closed to new replies.