I was able to get this fixed myself. By checking if $bp_like_comment_id was empty using PHP’s empty() function I was able to if it was an activity item or a comment I was dealing with. an example for anyone wondering
if ( empty( $bp_like_comment_id ) ) {
echo "this is not a comment";
}
else {
echo 'this is a comment';
}
I didn’t find anything to easily get the activity type of an item by its ID, does anyone know of any? Maybe I’m missing something.
Found bp_get_activity_type()
darrenmeehan
@darrenmeehan
11 years, 5 months ago
I’m currently customizing the BuudyPress Like plugin to include the “Like” button on comments in the BuddyPress’s activity though I could do with some help.
to figure out if its a comment or parent activity item we’re dealing with, can you figure out whats wrong with the following code?
if ( !bp_activity_comment_id() ){` $type = ‘activity’;
}
else {
$type = ‘activity_comment’;
}`
Has anyone carried out any work on something similar? I’ve finding it hard completing this, I’ve been reading through a ton of buddyPress code but can’t quite get my head around how to organize this