Put this function in the functions.php of the theme activated.
<?php
/**
* Modify the edit function of BuddyPress Edit Activity (made by @buddyboss).
*
* This function will hide the html source while editing the activity content
* containing images uploaded with rtMedia (made by @rtcamp).
*
* @link https://wordpress.org/plugins/buddypress-edit-activity/
* @link https://wordpress.org/plugins/buddypress-media/
*
* @param string $content
* @return string $content
*/
function bea_hide_html_from_edit_textarea( $content ) {
// Check if $content contains the word 'rtmedia'.
$flag = strstr( $content, 'rtmedia' );
if ( $flag ) {
$matches = array();
// Pull the text inside of 'rtmedia-activity-text' class out using regular expression.
preg_match( '#<div class="rtmedia-activity-text">(.*)</div>#s', $content, $matches );
// The 2nd array element of $matches is the raw text.
$content = $matches[1];
}
return $content;
}
add_filter( 'bea_get_activity_content', 'bea_hide_html_from_edit_textarea' );