group_forum_topic_forum_id_before_save

  • apply_filters( 'group_forum_topic_forum_id_before_save', $forum_id )

    Source Reference:

    • Component: BuddyPress :: bp-groups
      File: /bp-groups/bp-groups-forums.php :: Trac Source Line: 90
      function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) {
      	global $bp;
      
      	if ( empty( $topic_title ) || empty( $topic_text ) )
      		return false;
      
      	$topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
      	$topic_text  = apply_filters( 'group_forum_topic_text_before_save', $topic_text );
      	$topic_tags  = apply_filters( 'group_forum_topic_tags_before_save', $topic_tags );
      	$forum_id    = apply_filters( 'group_forum_topic_forum_id_before_save', $forum_id );
      
      	if ( $topic_id = bp_forums_new_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_tags' => $topic_tags, 'forum_id' => $forum_id ) ) ) {
      		$topic = bp_forums_get_topic_details( $topic_id );
      
      		$activity_action = sprintf( __( '%1$s started 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( $topic_text );
      
      		// Record this in activity streams
      		groups_record_activity( array(
      			'action'            => apply_filters_ref_array( 'groups_activity_new_forum_topic_action',  array( $activity_action,  $topic_text, &$topic ) ),
      

Comments are closed.