Please see below my solution. It's not ideal, because it breaks pagination a bit, but it's feasible for our use case, as we don't have too many new post activities.
// Filter the activity feed by the language:
// 1. buffer the activity entry output...
add_action('bp_before_activity_entry', function () {
ob_start();
});
// 2. clean the output if the activity is the post activity and languages don't match,
// flush otherwise.
add_action('bp_after_activity_entry', function () {
$get_lang = $_GET['lang'];
$language_code = get_activity_post_language_code();
if ( $language_code && $get_lang && $language_code !== $get_lang ) {
ob_end_clean();
} else {
ob_end_flush();
}
});
function get_activity_post_language_code() {
if ( ! bp_get_activity_secondary_item_id() ) {
return false;
}
$language_details = apply_filters( 'wpml_post_language_details', NULL, bp_get_activity_secondary_item_id() );
if ( ! $language_details ) {
return false;
}
return $language_details['language_code'];
}
Thank you for your feedback! Wow! That's great! I will report it further.
Have a lovely week!
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.