bp_blogs_activity_comment_permalink( string $retval = '' )

Changes activity comment permalinks to use the blog comment permalink instead of the activity permalink.

Description

This is only done if activity commenting is allowed and whether the parent activity item is a ‘new_blog_post’ entry.

Parameters

$retval

(Optional) The activity comment permalink.

Default value: ''

Return

(string)

Source

File: bp-blogs/bp-blogs-activity.php

function bp_blogs_activity_comment_permalink( $retval = '' ) {
	global $activities_template;

	// Get the current comment ID.
	$item_id = isset( $activities_template->activity->current_comment->item_id )
		? $activities_template->activity->current_comment->item_id
		: false;

	// Maybe adjust the link if item ID exists.
	if ( ( false !== $item_id ) && isset( buddypress()->blogs->allow_comments[ $item_id ] ) ) {
		$retval = $activities_template->activity->current_comment->primary_link;
	}

	return $retval;
}

Changelog

Changelog
Version Description
BuddyPress 2.0.0 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.