Support for buddypress
-
Hello Please can you add support to display the ratings for buddypress activity.
I have tried the this code which filters the activity dispaly in the buddypress plugin but the ratings are not being displayed
see code below
/* turn activity excerpt into a clickable link */ add_filter( 'bp_activity_create_summary', function ( $summary, $content, $activity, $extracted_media ) { if ( 'new_blog_post' !== $activity['type'] ) { return $summary; } // Get post title. $post_title = get_the_title( $activity['secondary_item_id'] ); // Get featured image. $featured_image = get_the_post_thumbnail( $activity['secondary_item_id'], 'thumbnail' ); // Check if the featured image exists. $featured_image_html = ! empty( $featured_image ) ? "<a href='" . esc_url( get_permalink( $activity['secondary_item_id'] ) ) . "'>" . $featured_image . "</a>" : ''; // Get visual rating. if ( function_exists( 'rmp_get_visual_rating' ) ) { $visual_rating = rmp_get_visual_rating( $activity['secondary_item_id'] ); $visual_rating_html = ! empty( $visual_rating ) ? "<div class='visual-rating'>" . $visual_rating . "</div>" : ''; } // Recreate summary. $summary = bp_create_excerpt( html_entity_decode( $content ), 225, array( 'html' => false, 'filter_shortcodes' => true, 'strip_tags' => true, 'remove_links' => true, ) ); $post_title_html = "<span class='post-title'>" . $post_title . "</span>"; return $post_title_html . $featured_image_html . $visual_rating_html . "<a href='" . esc_url( get_permalink( $activity['secondary_item_id'] ) ) . "'>" . $summary . "</a>"; }, 10, 4 );
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Support for buddypress’ is closed to new replies.