bp_acomment_name
Return the author name for the activity comment currently being displayed.
Description
(string) apply_filters( 'bp_acomment_name', (string) $activities_template_activity_current_comment_user_fullname, (unknown) $activities_template_activity_current_comment );
The use of the bp_acomment_name filter is deprecated. Please use 'bp_activity_comment_name'.
Returns (string)
$name The full name of the activity comment author.
Parameters (2)
- 0. $activities_template_activity_current_comment_user_fullname (string)
- The activities template activity current comment user fullname.
- 1. $activities_template_activity_current_comment (unknown)
- The activities template activity current comment.
Usage
- To run the hook, copy the example below.
- $activities_template_activity_current_comment_user_fullname = apply_filters( 'bp_acomment_name', $activities_template_activity_current_comment_user_fullname, $activities_template_activity_current_comment );
- if ( !empty( $activities_template_activity_current_comment_user_fullname ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_acomment_name callback
- function filter_bp_acomment_name( $activities_template_activity_current_comment_user_fullname, $activities_template_activity_current_comment ) {
- // make filter magic happen here...
- return $activities_template_activity_current_comment_user_fullname;
- };
- // add the filter
- add_filter( 'bp_acomment_name', 'filter_bp_acomment_name', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'bp_acomment_name', 'filter_bp_acomment_name', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /bp-activity/bp-activity-template.php
- $name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment ); // Backward compatibility.