Viewing 2 posts - 1 through 2 (of 2 total)
  • Question

    #33680
    @milena

    Hi ,

    I needed to add custom posts to the activity feed, and found this thread useful.

    @shanebp (in the buddypress forum) said :

    And if you go thru the trouble of creating a CPT, why not filter the activity action so it isn’t the generic ‘…wrote a new post’. For example:

    add_filter(‘bp_blogs_activity_new_post_action’, ‘record_cpt_activity_action’, 1, 3);
    function record_cpt_activity_action( $activity_action, $post, $post_permalink ) {
    global $bp;
    if( $post->post_type == ‘videos’ ) {
    if ( is_multisite() )
    $activity_action = sprintf( __( ‘%1$s created a new Videos post, %2$s, on the site %3$s’, ‘buddypress’ ), bp_core_get_userlink( (int) $post->post_author ), ‘‘ . $post->post_title . ‘‘, ‘‘ . get_blog_option( $blog_id, ‘blogname’ ) . ‘‘ );
    
    else
    $activity_action = sprintf( __( ‘%1$s created a new Videos post, %2$s’, ‘buddypress’ ), bp_core_get_userlink( (int) $post->post_author ), ‘‘ . $post->post_title . ‘‘ );
    
    }
    
    return $activity_action;
    }

    However if I do that, the link to the custom post itself disappears. Actually it shows up but is un-clickable.

    Is the code missing something?

    Would really appreciate the help!

    Milena

    Answers

    #33681
    @milena

    solved in buddypress.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The question ‘Custom Posts to Activity’ is closed to new replies.