bp_blogs_activity_comment_single_permalink

Changes single activity comment entries to use the blog comment permalink.

Description

(string) bp_blogs_activity_comment_single_permalink( (string) $retval, (BP_Activity_Activity) $activity ); 

This is only done if the activity comment is associated with a blog comment.

Returns (string)

Parameters (2)

0. $retval (string)
The activity permalink.
1. $activity (BP_Activity_Activity)
Activity object.

Usage

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

Defined (1)

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

/bp-blogs/bp-blogs-activity.php  
  1. function bp_blogs_activity_comment_single_permalink( $retval, $activity ) { 
  2. if ( 'activity_comment' !== $activity->type ) { 
  3. return $retval; 
  4.  
  5. return $retval; 
  6.  
  7. $parent_activity = new BP_Activity_Activity( $activity->item_id ); 
  8.  
  9. if ( isset( $parent_activity->type ) && bp_activity_post_type_get_tracking_arg( $parent_activity->type, 'post_type' ) ) { 
  10. $retval = $activity->primary_link; 
  11.  
  12. return $retval;