Eureka!
I think I’ve finally figured this out, a partial and reasonable solution anyway, and documenting it here for all the others who I have seen struggling with this problem for literally months or years in some cases. I’m sure there may be a more elegant way of handling it and perhaps someone can suggest a way that will survive upgrades and without editing core files (child theme changes?) but this “brute force” method works for the time being. This takes some explaining so hang in there with me.
Part of the problem is that the behavior is handled in different files depending upon whether you’re talking about updates (like What’s new type of updates and their replies) or Group forum topics and their replies. The group forum topics end up in the activity stream with the dreaded […] and do not expand which is a major bummer.
After many hours of tril and error and research I have found that the size of the excerpt for group forum topics is controlled by
/public_html/wp-content/plugins/buddypress/bp-core/bp-core-template.php beginning in the bp_create_excerpt function and the relevant parts that need to be changed are $length which has a default of 225 and array value for ‘ending’ which is “[…]” by default.
In my case I made the length 3000 which is long enough for some pretty long topic posts and ending I made “Continues, click title” to give the user a hint that if the text is longer than 3000 characters and they want to read the rest they’ll need to click the title of the topic in order to so. Still sub-optimal but a lot better than […] which is inscrutable. A link to the topic would be better so it could just say continues and the user would click that
function bp_create_excerpt( $text, $length = 3000, $options = array() ) {
// Backward compatibility. The third argument used to be a boolean $filter_shortcodes
$filter_shortcodes_default = is_bool( $options ) ? $options : true;
$defaults = array(
'ending' => __( ' [Continues, click title]', 'buddypress' ),
'exact' => false,
'html' => true,
'filter_shortcodes' => $filter_shortcodes_default
);
Now you also need to know that the length of the excerpt that is displayed in the activity stream in the first place whether an update, group forum topics, etc defaults to ~358 characters. That is controlled in /public_html/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php and possibly also in /public_html/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php.
Snippets from both:
bp-activity-filters.php
$excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
bp-acivity-template.php
$latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ) );
So by changing the 358 to a larger or smaller value you can change the “default” length of the “displayed” excerpt in the activity stream but the “actual” full excerpt (at least for group forum topics) is controlled by bp_create_excerpt in bp-core_template.php.
Since the group forum topic “actual” excerpts default to 225 characters as explained above which is less than 358 that is why you see the […] at the end of those excerpts by default. If you change the 358 above in bp-activity-filters.php to e.g.. 150, a value less than 225 then miraculously your group forum topics will have a “Read more” link but when you click the [Read more] link to expand the topic you will get at most 225 (150 + 75) characters and still the […]! That’s all you’ll ever be able to get. Once you change the $length discussed above to 3000 (or whatever), that is greater than 358 and so you will get the “displayed” excerpt of ~358 characters and a Read more link but the “actual” full excerpt will be up to 3000 characters long and when the user clicks the Read more link it will expand to it’s new maximum length of 3000, which in most cases will be the full text. More “breathing room” so to speak.
Now, it appears that these “actual” excerpts must be created at the time the group forum topic is created and stored in the database for later retrieval and display. So you cannot expect to make these changes and see them reflected in your older posts. It appears this will only take place for your new posts going forward. At least that seems to have been my experience as a group forum topic I had just created still had the […] and was only 225 and had the […]. After I made the above changes to bp-core-template.php my post was still the same. So I copied the text of the post and deleted the group forum topic post and re-created it. Voila! My topic text now had a “displayed” length of ~358, a [Read more] link AND when I clicked it the post expanded to its full “actual” length which was less than 3000 characters!
I’m not marking this as resolved because I’m hoping someone will come along and suggest a more elegant solution which will survive upgrades.