original_string: private function callback(array $matches) {
          $mediamanager = core_media_manager::instance();
  
          global $CFG, $PAGE;
          // Check if we ignore it.
          if (preg_match('/class="[^"]*nomediaplugin/i', $matches[0])) {
              return $matches[0];
          }
  
          // Get name.
          $name = trim($matches[2]);
          if (empty($name) or strpos($name, 'http') === 0) {
              $name = ''; // Use default name.
          }
  
          // Split provided URL into alternatives.
          $urls = $mediamanager->split_alternatives($matches[1], $width, $height);
  
          $options = [core_media_manager::OPTION_ORIGINAL_TEXT => $matches[0]];
          return $this->embed_alternatives($urls, $name, $width, $height, $options);
      }
code: private function callback(array $matches) {
          $mediamanager = core_media_manager::instance();
  
          global $CFG, $PAGE;
          // Check if we ignore it.
          if (preg_match('/class="[^"]*nomediaplugin/i', $matches[0])) {
              return $matches[0];
          }
  
          // Get name.
          $name = trim($matches[2]);
          if (empty($name) or strpos($name, 'http') === 0) {
              $name = ''; // Use default name.
          }
  
          // Split provided URL into alternatives.
          $urls = $mediamanager->split_alternatives($matches[1], $width, $height);
  
          $options = [core_media_manager::OPTION_ORIGINAL_TEXT => $matches[0]];
          return $this->embed_alternatives($urls, $name, $width, $height, $options);
      }
code_tokens: private function callback ( array $ matches ) { $ mediamanager = core_media_manager :: instance ( ) ; global $ CFG , $ PAGE ; // Check if we ignore it. if ( preg_match ( '/class="[^"]*nomediaplugin/i' , $ matches [ 0 ] ) ) { return $ matches [ 0 ] ; } // Get name. $ name = trim ( $ matches [ 2 ] ) ; if ( empty ( $ name ) or strpos ( $ name , 'http' ) === 0 ) { $ name = '' ; // Use default name. } // Split provided URL into alternatives. $ urls = $ mediamanager -> split_alternatives ( $ matches [ 1 ] , $ width , $ height ) ; $ options = [ core_media_manager :: OPTION_ORIGINAL_TEXT => $ matches [ 0 ] ] ; return $ this -> embed_alternatives ( $ urls , $ name , $ width , $ height , $ options ) ; }
docstring: Replace link with embedded content, if supported.
  
  @param array $matches
  @return string
docstring_tokens: Replace link with embedded content if supported .