group_forum_topic_text_before_save

  • apply_filters( 'group_forum_topic_text_before_save', $topic_text )

    Source Reference:

    • Component: BuddyPress :: bp-groups
      File: /bp-groups/bp-groups-forums.php :: Trac Source Line: 88
      }
      
      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
      
  • apply_filters( 'group_forum_topic_text_before_save',  $topic_text  )

    Source Reference:

    • Component: BuddyPress :: bp-groups
      File: /bp-groups/bp-groups-forums.php :: Trac Source Line: 120
      	}
      
      	return false;
      }
      
      function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
      	global $bp;
      
      	$topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
      	$topic_text  = apply_filters( 'group_forum_topic_text_before_save',  $topic_text  );
      
      	if ( $topic = bp_forums_update_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id, 'topic_tags' => $topic_tags ) ) ) {
      		// Update the activity stream item
      		if ( bp_is_active( 'activity' ) )
      			bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) );
      
      		$activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<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
      

Hook: add_filter: group_forum_topic_text_before_save instances (1)

  • add_filter( 'group_forum_topic_text_before_save',    'bp_activity_at_name_filter' )
    $tag: group_forum_topic_text_before_save
    $function_to_add: bp_activity_at_name_filter
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: BuddyPress :: bp-activity
      File: /bp-activity/bp-activity-filters.php :: Trac Source Line: 85
      // Apply BuddyPress defined filters
      add_filter( 'bp_get_activity_content',               'bp_activity_make_nofollow_filter' );
      add_filter( 'bp_get_activity_content_body',          'bp_activity_make_nofollow_filter' );
      add_filter( 'bp_get_activity_parent_content',        'bp_activity_make_nofollow_filter' );
      add_filter( 'bp_get_activity_latest_update',         'bp_activity_make_nofollow_filter' );
      add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_make_nofollow_filter' );
      add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_filter' );
      
      add_filter( 'pre_comment_content',                   'bp_activity_at_name_filter' );
      add_filter( 'group_forum_topic_text_before_save',    'bp_activity_at_name_filter' );
      add_filter( 'group_forum_post_text_before_save',     'bp_activity_at_name_filter' );
      
      add_filter( 'bp_get_activity_parent_content',        'bp_create_excerpt' );
      
      /**
       * Custom kses filtering for activity content
       *
       * @since 1.1.0
       *
       * @param string $content The activity content
      

Comments are closed.