Skip to:
Content
Pages
Categories
Search
Top
Bottom

‘bp_activity_add()’ doesn’t respect ‘primary_link’


  • Alex
    Participant

    @hempsworth

    This is the test code I”ve been using:

    `bp_activity_add(
    array(
    ‘action’ => $my_action,
    ‘content’ => $my_content,
    ‘primary_link’ => ‘http://example.com’,
    ‘component’ => ‘my_component’,
    ‘type’ => ‘my_type’,
    ‘user_id’ => $my_user_id,
    ‘item_id’ => $my_item_id
    )
    );`

    The activity is posted fine, however, the ‘Visit’ link doesn’t point to ‘http://example.com’, it’s still using the default activity permalink.

    Am I doing something wrong?

Viewing 1 replies (of 1 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    No, you’re not doing anything wrong – this appears to be intended behavior. Check out bp_activity_get_permalink() in bp-activity.php. The primary_link is used for the View href only when the activity type is new_blog_post, new_blog_comment, new_forum_topic, or new_forum_post.

    Would you consider opening an enhancement ticket on trac.buddypress.org for this issue? It seems to me that if a primary_link is provided by a custom component like yours, that it should be used in bp_activity_get_permalink().

Viewing 1 replies (of 1 total)
  • The topic ‘‘bp_activity_add()’ doesn’t respect ‘primary_link’’ is closed to new replies.
Skip to toolbar