bp_blogs_activity_comment_permalink

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

Description

(string) bp_blogs_activity_comment_permalink( (string) $retval = '' ); 

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

Returns (string)

Parameters (1)

0. $retval — Optional. (string) => ''
The activity comment permalink.

Usage

  1. if ( !function_exists( 'bp_blogs_activity_comment_permalink' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-activity.php'; 
  3.  
  4. // The activity comment permalink. 
  5. $retval = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_blogs_activity_comment_permalink($retval); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-blogs/bp-blogs-activity.php  
  1. function bp_blogs_activity_comment_permalink( $retval = '' ) { 
  2. global $activities_template; 
  3.  
  4. // Get the current comment ID. 
  5. $item_id = isset( $activities_template->activity->current_comment->item_id ) 
  6. ? $activities_template->activity->current_comment->item_id 
  7. : false; 
  8.  
  9. // Maybe adjust the link if item ID exists. 
  10. if ( ( false !== $item_id ) && isset(buddypress)->blogs->allow_comments[ $item_id ] ) ) { 
  11. $retval = $activities_template->activity->current_comment->primary_link; 
  12.  
  13. return $retval;