bbp_get_topic_split_link( mixed $args = '' )

Get split topic link

Description

Return the split link of the topic (but is bundled with each reply)

Parameters

$args

(mixed) (Optional) This function supports these arguments: - id: Reply id - link_before: HTML before the link - link_after: HTML after the link - split_text: Split text - split_title: Split title attribute

Default value: ''

Return

(string) Topic split link

Source

File: bp-forums/replies/template.php

	function bbp_get_topic_split_link( $args = '' ) {

		// Parse arguments against default values
		$r = bbp_parse_args( $args, array(
			'id'          => 0,
			'link_before' => '',
			'link_after'  => '',
			'split_text'  => esc_html__( 'Split',                           'buddyboss' ),
			'split_title' => esc_attr__( 'Split the topic from this reply', 'buddyboss' )
		), 'get_topic_split_link' );

		$reply_id = bbp_get_reply_id( $r['id'] );
		$topic_id = bbp_get_reply_topic_id( $reply_id );

		if ( empty( $reply_id ) || !current_user_can( 'moderate', $topic_id ) )
			return;

		$uri =  add_query_arg( array(
			'action'   => 'split',
			'reply_id' => $reply_id
		), bbp_get_topic_edit_url( $topic_id ) );

		$retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-topic-split-link">' . $r['split_text'] . '</a>' . $r['link_after'];

		return apply_filters( 'bbp_get_topic_split_link', $retval, $r );
	}

Changelog

Changelog
Version Description
bbPress (r2756) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.