Skip to content

Instantly share code, notes, and snippets.

@Alimir
Created December 30, 2020 14:20
Show Gist options
  • Save Alimir/3591e198b885ad1e8aa46e375d932f49 to your computer and use it in GitHub Desktop.
Save Alimir/3591e198b885ad1e8aa46e375d932f49 to your computer and use it in GitHub Desktop.
Display like button on custom activity group
<?php
function wp_ulike_custom_bp_activity_entry_content() {
global $activities_template;
if( ! empty( $activities_template->activity->component ) && $activities_template->activity->component === 'groups' ){
if( ! empty( $activities_template->activity->item_id ) && in_array( $activities_template->activity->item_id, array( '1' ) ) ){
echo wp_ulike_buddypress('put');
}
}
}
add_action( 'bp_activity_entry_content', 'wp_ulike_custom_bp_activity_entry_content', 15 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment