Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 13 years ago

#2380 closed enhancement (fixed)

Blog posts don't recognize @username

Reported by: paulhastings0's profile paulhastings0 Owned by:
Milestone: 1.6 Priority: normal
Severity: normal Version:
Component: Blogs Keywords:
Cc:

Description

WPMU 2.9.2
BP 1.2.3

When leaving a comment on a blog post @username is recognized and automatically converted into a link to @username's profile. However when writing a blog post @username is not recognized and it just comes out as plain text.

An example is here with @kasian4110.

Change History (9)

#1 @DJPaul
14 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #2372 - btw this is an enhancement rather than a defect as this currently isn't supported.

#2 @boonebgorges
14 years ago

  • Type changed from defect to enhancement

I don't think this is a duplicate of #2372 - that ticket is about BP notifications, while this one is about autolinking.

The answer is to put

add_filter( 'the_content', 'bp_activity_at_name_filter' );

somewhere. paulhastings0, it'll work in bp-custom.php.

#3 @r-a-y
14 years ago

@boonebgorges - I'm afraid a little bit more needs to be done. That filter will only parse usernames and add the @ sign in front of the username.

A notification function will need to be created and hooked when a blog comment is posted.

@paulhastings0 - View the bp_activity_at_message_notification() in bp-activity-notifications.php for hints, then combine with Boone's filter snippet above.

#4 @boonebgorges
14 years ago

Good point @r-a-y. It's even more complicated, because if the mention is early enough in the blog post (so that it gets included in the activity excerpt) a notification will get sent with the activity item. So you can either hook something to blog posts that cancels out the activity notification, or fix activity items so that they cache the entire content. Presumably the same thing will happen with forum posts, btw.

#5 @DJPaul
14 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Oops!

#6 @apeatling
14 years ago

  • Milestone changed from 1.2.4 to 1.3

#7 @boonebgorges
14 years ago

  • Milestone changed from 1.3 to 1.4

#8 @boonebgorges
13 years ago

(In [5609]) Run the_content through bp_activity_at_name_filter so that @-mentions are recognized. See #2380

#9 @boonebgorges
13 years ago

  • Keywords @username blog posts removed
  • Resolution set to fixed
  • Severity set to normal
  • Status changed from reopened to closed

In r5609, I added auto-linking for blog posts. For the broader issue of sending notifications, see #2372.

Note: See TracTickets for help on using tickets.