group_forum_post_topic_id_before_save

  • apply_filters( 'group_forum_post_topic_id_before_save', $topic_id )

    Source Reference:

    • Component: BuddyPress :: bp-groups
      File: /bp-groups/bp-groups-forums.php :: Trac Source Line: 51
      add_action( 'groups_details_updated', 'groups_update_group_forum' );
      
      function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
      	global $bp;
      
      	if ( empty( $post_text ) )
      		return false;
      
      	$post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
      	$topic_id  = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
      
      	if ( $post_id = bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) {
      		$topic = bp_forums_get_topic_details( $topic_id );
      
      		$activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
      		$activity_content = bp_create_excerpt( $post_text );
      		$primary_link = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
      
      		if ( $page )
      			$primary_link .= "?topic_page=" . $page;
      
    • Component: BuddyPress :: bp-groups
      File: /bp-groups/bp-groups-forums.php :: Trac Source Line: 154
      	}
      
      	return false;
      }
      
      function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
      	global $bp;
      
      	$post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
      	$topic_id  = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
      	$post      = bp_forums_get_post( $post_id );
      
      	if ( $post_id = bp_forums_insert_post( array( 'post_id' => $post_id, 'post_text' => $post_text, 'post_time' => $post->post_time, 'topic_id' => $topic_id, 'poster_id' => $post->poster_id ) ) ) {
      		$topic = bp_forums_get_topic_details( $topic_id );
      
      		$activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
      		$activity_content = bp_create_excerpt( $post_text );
      		$primary_link = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
      
      		if ( $page )
      

Comments are closed.