Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter on activity stream content.

  • @antonchanning

    Participant

    I maintain a couple of plugins that between them add support for a range of safe shortcodes to be used in comments, bbpress forum posts, buddypress group posts and the activity stream:

    However at some point the activity stream support seems to have broken.

    If I type: `this is [b]some bold[/b] text` into an activity update, it used to output:

    this is some bold text

    but now it outputs

    this is text

    It seems I can no longer filter on ‘bp_get_activity_content_body’. What do I need to change?

    Existing code:
    `add_filter( ‘bp_get_activity_content_body’, ‘bbp_whitelist_do_shortcode’ );`

Viewing 3 replies - 1 through 3 (of 3 total)
  • @antonchanning

    Participant

    In addition, a filter on displaying private messages in a similar manner would also be useful…

    @antonchanning

    Participant

    `add_filter( ‘bp_get_activity_content_body’, ‘bbp_whitelist_do_shortcode’ );`

    Needs to be:

    `add_filter( ‘bp_get_activity_content_body’, ‘bbp_whitelist_do_shortcode’, 1 );`

    Apparently something else on the same filter was stripping shortcodes and their contents out of the activity body BEFORE this filter was being applied, so I just had to give it a high priority to work.

    @antonchanning

    Participant

    Also I found the other hook I was looking for, so I can apply the shortcodes to private messages. It turned out I can use `bp_get_the_thread_message_content` for that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter on activity stream content.’ is closed to new replies.
Skip to toolbar