bbp_get_reply_move_link( array $args = array() )

Get move reply link


Description Description

Return the move link of the reply


Parameters Parameters

$args

(Optional) This function supports these arguments: - id: Reply id - link_before: HTML before the link - link_after: HTML after the link - move_text: Move text - move_title: Move title attribute

Default value: array()


Top ↑

Return Return

(string) Reply move link


Top ↑

Source Source

File: includes/replies/template.php

	function bbp_get_reply_move_link( $args = array() ) {

		// Parse arguments against default values
		$r = bbp_parse_args( $args, array(
			'id'          => 0,
			'link_before' => '',
			'link_after'  => '',
			'split_text'  => esc_html__( 'Move',            'bbpress' ),
			'split_title' => esc_attr__( 'Move this reply', 'bbpress' )
		), 'get_reply_move_link' );

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

		// Bail if no reply ID or user cannot moderate
		if ( empty( $reply_id ) || ! current_user_can( 'moderate', $topic_id ) ) {
			return;
		}

		$uri = add_query_arg( array(
			'action'   => 'move',
			'reply_id' => $reply_id
		), bbp_get_reply_edit_url( $reply_id ) );

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

		// Filter & return
		return apply_filters( 'bbp_get_reply_move_link', $retval, $r, $args );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.