So, you want to change the 358?
you can do that with something like this
function cc_custom_excerpt_length() {
return '20';
}
add_filter( 'bp_activity_excerpt_length', 'cc_custom_excerpt_length' );
Using that will change the activity excerpt length to 20.
Disclaimer: i am not a professional and this is not advice.
thanks @chrisclayton! using your method I’ve been able to modify read more link too, but how could I hook into $excerpt = bp_create_excerpt( $text, $excerpt_length, array( 'ending' => __( '…', 'buddypress' ) ) );
to change ending text ‘…’?
This line’s controlling it.
$ending = apply_filters( 'bp_excerpt_append_text', $ending );
So, we want to use
function cc_excerpt_append_text() {
return 'Stop Reading';
}
add_filter( 'bp_excerpt_append_text', 'cc_excerpt_append_text' );
Again, just change ‘Stop Reading’ to whatever you want to replace it.
BTW. If you’d like to read more about filters – this one’s a great one. While it’s focused on themes, it’s the exact same theory
Using Filter Hooks in WordPress Child Themes