Fatal error: Call to undefined function media_filter I've upgraded Media module from 2.0-alpha2+6-dev and 2.0-beta1, however now I've the following error on some random pages:

( ! ) Fatal error: Call to undefined function `media_filter()` in my_module.module on line 224


My code in hook_field_formatter_view in my module is:

$element[0]['#markup']
  = '&lt;div class="my-formatter-slide-down-container"&gt;&lt;div class="text-summary ' . ($settings['hide_summary'] ? 'hiding' : '') . '"&gt;'
  . media_filter($text_summary)
  . '&lt;a href="' . $read_more_link . '" class="read-more"&gt;' . $read_more_text . '&lt;/a&gt;'
  . '&lt;/div&gt;&lt;/div&gt;';


The code of that media_filter function was:

function media_filter($text) {
  $text = preg_replace_callback(MEDIA_TOKEN_REGEX, 'media_token_to_markup', $text);
  return $text;
}


What is the current replacement for that function which I can use instead?
Prior to newer version of Media, media_wysiwyg_filter should be used instead which will perform media markup filter. This can be found in modules/media_wysiwyg/includes/media_wysiwyg.filter.inc.

The code is:

/**
 * Filter callback for media markup filter.
 */
function media_wysiwyg_filter($text) {
  $text = preg_replace_callback(MEDIA_WYSIWYG_TOKEN_REGEX, 'media_wysiwyg_token_to_markup', $text);
  return $text;
}